mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
reorder service and admin panel
This commit is contained in:
parent
1774c2ee5e
commit
0aa765045a
3 changed files with 40 additions and 30 deletions
|
@ -23,6 +23,17 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
if yunohost service status | grep -q $app
|
||||
then
|
||||
echo "Remove $app service"
|
||||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
|
@ -30,17 +41,6 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
#if yunohost service status | grep -q $app
|
||||
#then
|
||||
# echo "Remove $app service"
|
||||
# yunohost service remove $app
|
||||
#fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -68,7 +68,6 @@ ynh_secure_remove "$final_path"
|
|||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
systemctl restart nginx
|
||||
|
||||
#=================================================
|
||||
# REMOVE PHP-FPM CONFIGURATION
|
||||
|
@ -104,7 +103,7 @@ fi
|
|||
#ynh_secure_remove "/etc/cron.d/$app"
|
||||
|
||||
# Remove a directory securely
|
||||
#ynh_secure_remove "/etc/$app/"
|
||||
ynh_secure_remove "/etc/$app/"
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove "/var/log/$app/"
|
||||
|
|
|
@ -27,8 +27,8 @@ ynh_abort_if_errors
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
admin=$(ynh_app_setting_get $app admin)
|
||||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
|
@ -95,7 +95,6 @@ chown -R root: $final_path
|
|||
#=================================================
|
||||
|
||||
#ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
||||
#ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -106,12 +105,6 @@ chown -R root: $final_path
|
|||
# Define and install dependencies
|
||||
#ynh_install_app_dependencies mysql
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
#yunohost service add $app --log "/var/log/$app/APP.log"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
@ -119,6 +112,12 @@ chown -R root: $final_path
|
|||
ynh_restore_file "/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --log "/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
#=================================================
|
||||
|
@ -139,5 +138,9 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
|||
|
||||
#systemctl reload php5-fpm
|
||||
systemctl reload nginx
|
||||
systemctl restart "$app"
|
||||
|
||||
#=================================================
|
||||
# START SERVICE
|
||||
#=================================================
|
||||
|
||||
yunohost service start $app
|
||||
|
|
|
@ -72,6 +72,9 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
# Stop writefreely for upgrade
|
||||
yunohost service stop "$app"
|
||||
|
||||
#=================================================
|
||||
# CHECK THE PATH
|
||||
#=================================================
|
||||
|
@ -81,13 +84,6 @@ path_url=$(ynh_normalize_url_path $path_url)
|
|||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -95,6 +91,13 @@ ynh_add_nginx_config
|
|||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -166,4 +169,9 @@ fi
|
|||
#=================================================
|
||||
|
||||
systemctl reload nginx
|
||||
systemctl restart "$app"
|
||||
|
||||
#=================================================
|
||||
# START SERVICE
|
||||
#=================================================
|
||||
|
||||
yunohost service start $app
|
||||
|
|
Loading…
Add table
Reference in a new issue