1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/syncthing_ynh.git synced 2024-09-03 20:26:23 +02:00

Remove arch helper

This commit is contained in:
ericgaspar 2021-11-20 18:53:23 +01:00
parent 2b8cf9fa27
commit 1c74971f8c
No known key found for this signature in database
GPG key ID: 574F281483054D44
9 changed files with 19 additions and 24 deletions

View file

@ -64,7 +64,7 @@ echo "Handling asset at $asset_url"
# Leave $src empty to ignore the asset
case $asset_url in
*"linux-arm-"*)
src="arm"
src="armhf"
;;
*"linux-arm64-"*)
src="arm64"
@ -73,7 +73,7 @@ case $asset_url in
src="i386"
;;
*"linux-amd64-"*)
src="x86-64"
src="amd64"
;;
*)
src=""

View file

@ -25,7 +25,7 @@
}
],
"requirements": {
"yunohost": ">= 4.1.3"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
@ -35,8 +35,7 @@
"install": [
{
"name": "domain",
"type": "domain",
"example": "example.com"
"type": "domain"
},
{
"name": "path",
@ -46,8 +45,7 @@
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
"type": "user"
}
]
}

View file

@ -27,6 +27,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
architecture=$YNH_ARCH
app=$YNH_APP_INSTANCE_NAME

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
sync_home=$(ynh_app_setting_get --app=$app --key=sync_home)
sync_port=$(ynh_app_setting_get --app=$app --key=sync_port)
@ -50,6 +51,17 @@ ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the app data directory with the command `yunohost app remove syncthing --purge`
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing $app data directory..." --weight=2
ynh_secure_remove --file="$sync_home"
fi
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================

View file

@ -38,8 +38,6 @@ sync_port=$(ynh_app_setting_get --app=$app --key=sync_port)
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "

View file

@ -20,6 +20,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
architecture=$YNH_ARCH
sync_home=$(ynh_app_setting_get --app=$app --key=sync_home)
sync_port=$(ynh_app_setting_get --app=$app --key=sync_port)
@ -100,7 +101,6 @@ if [ -z $gui_port ]; then
ynh_remove_logrotate
ynh_remove_app_dependencies
fi
# Cleaning legacy permissions

View file

@ -1,14 +0,0 @@
#!/bin/bash
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
architecture="arm64"
elif [ -n "$(uname -m | grep 64)" ]; then
architecture="x86-64"
elif [ -n "$(uname -m | grep 86)" ]; then
architecture="i386"
elif [ -n "$(uname -m | grep arm)" ]; then
architecture="arm"
else
ynh_die "Unable to detect your achitecture, please open a bug describing \
your hardware and the result of the command \"uname -m\"." 1
fi