diff --git a/scripts/install b/scripts/install index 49781b4..a351752 100644 --- a/scripts/install +++ b/scripts/install @@ -115,6 +115,6 @@ then fi # Reload services -sudo service rsyslog restart || true -sudo service nginx reload || true -sudo service gogs restart || true +sudo systemctl restart rsyslog.service || true +sudo systemctl reload nginx.service || true +sudo systemctl restart gogs.service || true diff --git a/scripts/remove b/scripts/remove index a6e06d6..8129c74 100644 --- a/scripts/remove +++ b/scripts/remove @@ -39,5 +39,5 @@ sudo systemctl daemon-reload sudo yunohost service remove gogs # Reload services -sudo service nginx reload || true -sudo service rsyslog restart || true +sudo systemctl restart rsyslog.service || true +sudo systemctl reload nginx.service || true diff --git a/scripts/restore b/scripts/restore index 4b10585..560375a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,6 +66,6 @@ sudo systemctl enable gogs.service sudo yunohost service add gogs --log /var/log/gogs.log # Reload services -sudo service nginx reload || true -sudo service rsyslog restart || true -sudo service gogs start || true +sudo systemctl restart rsyslog.service || true +sudo systemctl reload nginx.service || true +sudo systemctl restart gogs.service || true diff --git a/scripts/upgrade b/scripts/upgrade index 4fe1d7a..660eaba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,8 +21,6 @@ admin=$(ynh_app_setting_get "$app" adminusername) key=$(ynh_app_setting_get "$app" secret_key) is_public=$(ynh_app_setting_get "$app" is_public) -repo_path=$(ynh_app_setting_get "$app" repopath) - # Stop service sudo systemctl stop gogs.service @@ -61,10 +59,6 @@ sudo systemctl enable gogs.service # Configure logrotate sudo cp ../conf/logrotate /etc/logrotate.d/gogs -# Restore ldap config -sudo sed -i "s@yuno_admin@$admin@g" ../conf/login_source.sql -ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql - # Modify Nginx configuration file and copy it to Nginx conf directory sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf if [ "$path" = "/" ] @@ -82,6 +76,10 @@ then fi # Reload services -sudo service rsyslog restart || true -sudo service nginx reload || true -sudo service gogs start || true +sudo systemctl restart rsyslog.service || true +sudo systemctl reload nginx.service || true +sudo systemctl restart gogs.service || true + +# Restore ldap config +sudo sed -i "s@yuno_admin@$admin@g" ../conf/login_source.sql +ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql