summarylogtreecommitdiffstats
path: root/vpnc
diff options
context:
space:
mode:
authorOleksandr Natalenko2015-06-08 13:01:56 +0300
committerOleksandr Natalenko2015-06-08 13:01:56 +0300
commit85e54864f19f49ccb34c0079407c6dab38311ac1 (patch)
treec76bf494444604a912b2102d19fefb3af60eaf83 /vpnc
downloadaur-85e54864f19f49ccb34c0079407c6dab38311ac1.tar.gz
initial import
Diffstat (limited to 'vpnc')
-rw-r--r--vpnc21
1 files changed, 21 insertions, 0 deletions
diff --git a/vpnc b/vpnc
new file mode 100644
index 000000000000..77e63acfa812
--- /dev/null
+++ b/vpnc
@@ -0,0 +1,21 @@
+#! /bin/bash
+
+vpnc_up() {
+ VpncConfig="${VpncConfig:-/etc/vpnc/default.conf}"
+ VpncFlags="${VpncFlags:-}"
+
+ if ! /usr/bin/vpnc $VpncFlags "$VpncConfig"; then
+ report_error "Establishing vpnc connection failed."
+ return 1
+ fi
+}
+
+vpnc_down() {
+ if ! /usr/bin/vpnc-disconnect; then
+ report_error "Could not disconnect vpnc connection. Trying to kill process."
+ if ! pkill -9 -x vpnc &>/dev/null; then
+ report_error "Unable to terminate or find vpnc process."
+ fi
+ return 1
+ fi
+}