mirror of
https://github.com/YunoHost-Apps/statpingng_ynh.git
synced 2024-09-03 20:26:24 +02:00
commit
587452e3dc
3 changed files with 6 additions and 35 deletions
|
@ -13,31 +13,3 @@ STATPING_VERSION="0.90.80"
|
||||||
get_ip() {
|
get_ip() {
|
||||||
curl ip.me
|
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ ynh_change_url_nginx_config
|
||||||
#==================================================
|
#==================================================
|
||||||
# Change config file
|
# 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_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
|
sed -i "/DOMAIN=/c\DOMAIN=https://${new_domain}" $install_dir/.env
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,15 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
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
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
pushd "$install_dir"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
install_statping
|
|
||||||
popd
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:$app "$install_dir"
|
chown -R $app:$app "$install_dir"
|
||||||
|
chmod +x $install_dir/statping
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue