diff --git a/install-vpnmon.sh b/install-vpnmon.sh new file mode 100755 index 0000000..4ca0794 --- /dev/null +++ b/install-vpnmon.sh @@ -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 \ No newline at end of file