diff --git a/scripts/install b/scripts/install index 2fd47aa..6d1be66 100755 --- a/scripts/install +++ b/scripts/install @@ -157,13 +157,10 @@ chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" #================================================= -# CREATE TEMP DIRECTORY +# REMOVE TEMP DIRECTORY #================================================= -ynh_script_progression --message="Creating temp directory..." --weight=1 -mkdir -p "/tmp/$app" -chmod 700 "/tmp/$app" -chmod -R go-rwx "/tmp/$app" -chown -R $app:$app "/tmp/$app" +ynh_script_progression --message="Cleanup temp directory..." --weight=1 +ynh_secure_remove --file="/tmp/$app" #================================================= # ADD A CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 9576832..1bd65ad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -87,6 +87,12 @@ chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:$app "$datadir" +#================================================= +# REMOVE TEMP DIRECTORY +#================================================= +ynh_script_progression --message="Cleanup temp directory..." --weight=1 +ynh_secure_remove --file="/tmp/$app" + #================================================= # ADD A CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c234e8e..979ea87 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,13 +148,10 @@ chmod 400 "$final_path/paperless.conf" chown $app:$app "$final_path/paperless.conf" #================================================= -# ENSURE TEMP DIR OWNERSHIP +# REMOVE TEMP DIRECTORY #================================================= -ynh_script_progression --message="Updating temp directory ownership..." --weight=1 -mkdir -p "/tmp/$app" -chmod 700 "/tmp/$app" -chmod -R go-rwx "/tmp/$app" -chown -R $app:$app "/tmp/$app" +ynh_script_progression --message="Cleanup temp directory..." --weight=1 +ynh_secure_remove --file="/tmp/$app" #================================================= # SETUP THE DATABASE