Create install-vpnmon.sh

This commit is contained in:
2022-05-22 10:13:22 -05:00
parent aedc566dbc
commit ee49cc7244

31
install-vpnmon.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Wrapper script for install, for easier execution via URL.
source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
echo ""
echo -e "${idsCL[LightGreen]}L2TP VPN Monitor Installation Script${idsCL[Default]}"
echo ""
do_with_root set -eu
do_with_root git clone https://git.schroedercity.com/voltron/vpnmon.git /opt/idssys/vpnmon
do_with_root ln -s /opt/idssys/vpnmon/run.sh /usr/local/bin/vpnmon
if [ ! -d "/opt/idssys/defaults" ]; then
do_with_root set -eu
do_with_root git clone https://git.schroedercity.com/voltron/iDS-Defaults.git /opt/idssys/defaults
fi
echo -e "${idsCL[Yellow]}Adding task to crontab... ${idsCL[Default]}"
(crontab -l ; echo "@reboot /usr/local/bin/vpnmon start >/dev/null 2>&1")| crontab -
(crontab -l ; echo "*/5 * * * * /usr/local/bin/vpnmon check >/dev/null 2>&1")| crontab -
echo ""
echo -e "${idsCL[Yellow]}L2TP VPN Monitor has been Installed.${idsCL[Default]}"
echo ""
exit 0