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:
parent
d37584eeef
commit
d56d744cb6
7 changed files with 15 additions and 53 deletions
|
@ -6,8 +6,8 @@ After=network.target
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__INSTALL_DIR__/
|
WorkingDirectory=__INSTALL_DIR__/sources/
|
||||||
ExecStart=/usr/bin/dotnet __INSTALL_DIR__/DnsServerApp.dll __DATA_DIR__
|
ExecStart=__INSTALL_DIR__/dotnet/dotnet __INSTALL_DIR__/sources/DnsServerApp.dll __DATA_DIR__
|
||||||
Restart=always
|
Restart=always
|
||||||
# Restart service after 10 seconds if the dotnet service crashes:
|
# Restart service after 10 seconds if the dotnet service crashes:
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
|
@ -13,12 +13,6 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP DOTNET
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup --src_path="/opt/dotnet"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping $app's 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"
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -24,7 +24,7 @@ ynh_change_url_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# 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"
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
|
|
@ -7,25 +7,14 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# 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"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
|
@ -29,14 +29,6 @@ ynh_remove_nginx_config
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove --file="/var/log/$app"
|
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
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -8,14 +8,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
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
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -10,26 +10,20 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# 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"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
# ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
#=================================================
|
if [ ! -d "$install_dir/dotnet" ]; then
|
||||||
# INSTALL DOTNET
|
# We expect legacy install in /opt
|
||||||
#=================================================
|
ynh_secure_remove --file="/opt/dotnet"
|
||||||
ynh_script_progression --message="Updating dotnet..." --weight=1
|
ynh_secure_remove --file="/usr/bin/dotnet"
|
||||||
|
fi
|
||||||
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
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# 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
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# 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"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
Loading…
Reference in a new issue