1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/statpingng_ynh.git synced 2024-09-03 20:26:24 +02:00
statpingng_ynh/scripts/_common.sh
Éric Gaspar 8b4c9f95cf v2
2023-06-14 11:05:41 +02:00

44 lines
946 B
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#REMOVEME? pkg_dependencies="postgresql"
#=================================================
# PERSONAL HELPERS
#=================================================
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
}