Files
Tunle/scripts/generic.sh
2020-07-30 11:26:38 -04:00

17 lines
340 B
Bash

#!/usr/bin/env bash
set -euo pipefail
if [[ ! -d "/tmp/vpn" ]]; then
echo "Mount OpenVPN Config in /tmp/vpn/"
exit 1
fi
config="$(find /tmp/vpn/ -type f -name '*.ovpn')"
if [[ -z "${config}" ]]; then
echo "No ovpn config found in /tmp/vpn/"
exit 1
fi
openvpn --config "${config}" --user user --group user --auth-nocache