From 441c407267b34ece1f142a01f204b1a1758bca1a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 Jan 2022 22:50:00 +0100 Subject: [PATCH] 4.3.0 --- manifest.json | 2 +- scripts/_common.sh | 24 ------------------------ scripts/install | 6 +----- scripts/remove | 2 -- scripts/restore | 5 ++--- scripts/upgrade | 2 +- 6 files changed, 5 insertions(+), 36 deletions(-) diff --git a/manifest.json b/manifest.json index 69636fa..45a94f5 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "url": "blog.cecchettosylvain.fr" }, "requirements": { - "yunohost": ">= 4.2.3" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index a366e7f..e5be016 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,30 +19,6 @@ package_check_dependencies="xserver-xorg-video-dummy" # EXPERIMENTAL HELPERS #================================================= -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - 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 - architecture="unknown" - fi - echo $architecture -} - #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index c5d7ea1..80c8382 100644 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,7 @@ path_url=$YNH_APP_ARG_PATH is_public=1 launch_on_boot=$YNH_APP_ARG_LAUNCH_ON_BOOT open_webserver_port=$YNH_APP_ARG_OPEN_WEBSERVER_PORT -arch=$(ynh_detect_arch) +arch=$YNH_ARCH app=$YNH_APP_INSTANCE_NAME @@ -65,10 +65,6 @@ ynh_script_progression --message="Finding an available port..." port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port -# Optional: Expose this port publicly -# (N.B.: you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - # Open the port # ynh_script_progression --message="Configuring firewall..." if [ "$open_webserver_port" -eq 1 ] diff --git a/scripts/remove b/scripts/remove index b44b55c..5229a82 100644 --- a/scripts/remove +++ b/scripts/remove @@ -43,7 +43,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config - #================================================= # REMOVE DEPENDENCIES #================================================= @@ -68,7 +67,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config - #================================================= # CLOSE A PORT #================================================= diff --git a/scripts/restore b/scripts/restore index 27218f7..9d3e6fc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) launch_on_boot=$(ynh_app_setting_get --app=$app --key=launch_on_boot) open_webserver_port=$(ynh_app_setting_get --app=$app --key=open_webserver_port) port=$(ynh_app_setting_get --app=$app --key=port) -arch=$(ynh_detect_arch) +arch=$YNH_ARCH #================================================= # FIND AND OPEN A PORT @@ -52,8 +52,7 @@ fi #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 83ddaac..1a529c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) launch_on_boot=$(ynh_app_setting_get --app=$app --key=launch_on_boot) open_webserver_port=$(ynh_app_setting_get --app=$app --key=open_webserver_port) port=$(ynh_app_setting_get --app=$app --key=port) -arch=$(ynh_detect_arch) +arch=$YNH_ARCH #================================================= # CHECK VERSION