1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/technitium-dns_ynh.git synced 2024-09-03 20:26:36 +02:00

install dotnet in install_dir

This commit is contained in:
Salamandar 2024-03-07 17:13:03 +01:00
parent d37584eeef
commit d56d744cb6
7 changed files with 15 additions and 53 deletions

View file

@ -6,8 +6,8 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
ExecStart=/usr/bin/dotnet __INSTALL_DIR__/DnsServerApp.dll __DATA_DIR__
WorkingDirectory=__INSTALL_DIR__/sources/
ExecStart=__INSTALL_DIR__/dotnet/dotnet __INSTALL_DIR__/sources/DnsServerApp.dll __DATA_DIR__
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10

View file

@ -13,12 +13,6 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP DOTNET
#=================================================
ynh_backup --src_path="/opt/dotnet"
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Stopping $app's systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
@ -24,7 +24,7 @@ ynh_change_url_nginx_config
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_script_progression --message="Starting $app's systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"

View file

@ -7,25 +7,14 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# INSTALL DOTNET
#=================================================
ynh_script_progression --message="Installing dotnet..." --weight=1
ynh_setup_source --source_id=dotnet --dest_dir="/opt/dotnet"
chmod -R o-rwx "/opt/dotnet"
chown -R "$app:www-data" "/opt/dotnet"
ln -sf /opt/dotnet/dotnet /usr/bin
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir/sources"
ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"

View file

@ -29,14 +29,6 @@ ynh_remove_nginx_config
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing Dotnet..." --weight=1
ynh_secure_remove --file="/usr/bin/dotnet"
ynh_secure_remove --file="/opt/dotnet"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -8,14 +8,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE DOTNET
#=================================================
ynh_script_progression --message="Restoring dotnet..."
ynh_restore_file --origin_path="/opt/dotnet"
ln -sf /opt/dotnet/dotnet /usr/bin
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================

View file

@ -10,26 +10,20 @@ source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_script_progression --message="Stopping $app's systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
# ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#=================================================
# INSTALL DOTNET
#=================================================
ynh_script_progression --message="Updating dotnet..." --weight=1
ynh_setup_source --source_id=dotnet --dest_dir="/opt/dotnet" --full_replace=1
chmod -R o-rwx "/opt/dotnet"
chown -R "$app:www-data" "/opt/dotnet"
ln -sf /opt/dotnet/dotnet /usr/bin
if [ ! -d "$install_dir/dotnet" ]; then
# We expect legacy install in /opt
ynh_secure_remove --file="/opt/dotnet"
ynh_secure_remove --file="/usr/bin/dotnet"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -37,7 +31,8 @@ ln -sf /opt/dotnet/dotnet /usr/bin
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1
ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_replace=1
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"