2022-11-27 09:49:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
2023-01-02 15:47:57 +01:00
|
|
|
pkg_dependencies="postgresql"
|
2022-11-27 09:49:18 +01:00
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
|
|
STATPING_VERSION="0.90.80"
|
|
|
|
|
|
|
|
get_ip() {
|
|
|
|
curl ip.me
|
|
|
|
}
|
|
|
|
# inspired by restic helper
|
2023-01-02 15:47:57 +01:00
|
|
|
install_statping () {
|
2022-11-27 09:49:18 +01:00
|
|
|
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
|
2023-01-02 15:47:57 +01:00
|
|
|
tar zxf statping-linux-$arch.tar.gz
|
|
|
|
rm statping-linux-$arch.tar.gz
|
2022-11-27 09:49:18 +01:00
|
|
|
chmod +x statping
|
|
|
|
}
|
|
|
|
|