mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
Add purge option
This commit is contained in:
parent
b67b74c229
commit
c693260e03
5 changed files with 17 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
path="/" (PATH)
|
path="/"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
port="7777" (PORT)
|
port="7777"
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=0
|
||||||
|
|
|
@ -3,4 +3,3 @@ SOURCE_SUM=099bf0cec59614f0f6151f0809c8580b85d5fe701892dda96263b8aee743d5d8
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
SOURCE_FILENAME=
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"url": "http://hastebin.com/",
|
"url": "http://hastebin.com/",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"website": "https://example.com",
|
"website": "http://hastebin.com/",
|
||||||
"demo": "http://hastebin.com/",
|
"demo": "http://hastebin.com/",
|
||||||
"userdoc": "https://hastebin.com/about.md",
|
"userdoc": "https://hastebin.com/about.md",
|
||||||
"code": "https://github.com/seejohnrun/haste-server"
|
"code": "https://github.com/seejohnrun/haste-server"
|
||||||
|
|
|
@ -78,6 +78,17 @@ ynh_secure_remove --file="/usr/bin/$app"
|
||||||
|
|
||||||
ynh_secure_remove --file="$data_path"
|
ynh_secure_remove --file="$data_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DATA DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Remove the data directory if --purge option is used
|
||||||
|
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
||||||
|
then
|
||||||
|
ynh_script_progression --message="Removing app data directory..." --weight=1
|
||||||
|
ynh_secure_remove --file="$data_path"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NODEJS
|
# REMOVE NODEJS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -33,8 +33,7 @@ data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
||||||
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path || ynh_die "There is already a directory: $final_path "
|
||||||
|| ynh_die "There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
|
Loading…
Add table
Reference in a new issue