diff --git a/scripts/_common.sh b/scripts/_common.sh index c3807fc..0ad910a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,31 +13,3 @@ STATPING_VERSION="0.90.80" get_ip() { curl ip.me } -# inspired by restic helper -install_statping () { - architecture=$(uname -m) - arch='' - case $architecture in - i386|i686) - arch="386" - ;; - x86_64) - arch=amd64 - ;; - armv*) - arch=arm-7 - ;; - aarch64) - arch=arm64 - ;; - *) - echo - ynh_die --message="Unsupported architecture \"$architecture\"" - ;; - esac - wget https://github.com/statping-ng/statping-ng/releases/download/v$STATPING_VERSION/statping-linux-$arch.tar.gz 2>&1 >/dev/null - tar zxf statping-linux-$arch.tar.gz - rm statping-linux-$arch.tar.gz - chmod +x statping -} - diff --git a/scripts/change_url b/scripts/change_url index 63cd06e..934fa58 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,10 +28,10 @@ ynh_change_url_nginx_config #================================================== # Change config file #================================================== -ynh_script_progression --message="Modifying configuration fileā€¦" --weight=1 +ynh_script_progression --message="Modifying configuration file..." --weight=1 #ynh_delete_file_checksum --file="$install_dir/.env" -#ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" +#ynh_add_config --template=".env" --destination="$install_dir/.env" sed -i "/DOMAIN=/c\DOMAIN=https://${new_domain}" $install_dir/.env diff --git a/scripts/upgrade b/scripts/upgrade index f1cc9a6..ed896b0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,16 +30,15 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from app.src - pushd "$install_dir" - install_statping - popd + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" fi chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" +chmod +x $install_dir/statping #================================================= # NGINX CONFIGURATION