diff --git a/scripts/remove b/scripts/remove index e4fcab5..af0c466 100644 --- a/scripts/remove +++ b/scripts/remove @@ -3,6 +3,11 @@ # Exit on command errors and treat unset variables as an error set -u +if [ ! -e ._common ]; then + # Get file fonction if not been to the current directory + sudo cp ../settings/scripts/_common ./_common + sudo chmod a+rx _common +fi # Source app helpers source ./_common source /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index 69e60e4..043e995 100644 --- a/scripts/restore +++ b/scripts/restore @@ -3,6 +3,11 @@ # causes the shell to exit if any subcommand or pipeline returns a non-zero status set -eu +if [ ! -e ._common ]; then + # Get file fonction if not been to the current directory + sudo cp ../settings/scripts/_common ./_common + sudo chmod a+rx _common +fi # Source app helpers source /usr/share/yunohost/helpers @@ -43,6 +48,9 @@ if [ -f $phpfpm_ini ]; then You should safely delete it before restoring this app." fi +# Create system user dedicace for this app +ynh_system_user_create $app + # Restore sources & data sudo cp -a "./sources" $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 362cbd0..d7dfcf6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -2,6 +2,12 @@ # Exit on command errors and treat unset variables as an error set -eu + +if [ ! -e ._common ]; then + # Get file fonction if not been to the current directory + sudo cp ../settings/scripts/_common ./_common + sudo chmod a+rx _common +fi # Source app helpers source ./_common source /usr/share/yunohost/helpers