aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vpnsetup19
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/vpnsetup b/bin/vpnsetup
index 0316688..5b3df44 100755
--- a/bin/vpnsetup
+++ b/bin/vpnsetup
@@ -22,8 +22,9 @@ __vpnsetup_help() {
echo -e "vpnsetup [command] [endpoint]\n\nThe vpnsetup commands are:\n"
tab=$'\t'
column -t -s $'\t' <<HERE
- start${tab}Start the VPN service.
+ log${tab}Show the logs for the VPN service.
restart${tab}Restart the VPN service. The default if no command was passed.
+ start${tab}Start the VPN service.
stop${tab}Stop the VPN service.
HERE
@@ -59,11 +60,21 @@ if [ "$1" != "" ]; then
cmd="$1"
fi
+# Check the endpoint to use.
+endpoint="SUSE-NUE"
+if [ "$2" != "" ]; then
+ endpoint="$2"
+fi
+
case "$cmd" in
-h | --help)
__vpnsetup_help
exit 0
;;
+ log | logs)
+ sudo journalctl -u "openvpn@$endpoint.service"
+ exit 0
+ ;;
start | restart)
sudo cp /etc/resolv.conf.vpn /etc/resolv.conf
;;
@@ -77,10 +88,4 @@ case "$cmd" in
;;
esac
-# Check the endpoint to use.
-endpoint="SUSE-NUE"
-if [ "$2" != "" ]; then
- endpoint="$2"
-fi
-
sudo systemctl $cmd "openvpn@$endpoint.service"