]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Adding failing function CP()
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 23 Apr 2020 06:06:06 +0000 (08:06 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 23 Apr 2020 06:06:06 +0000 (08:06 +0200)
bin/start-openfortivpn
lib/functions.rc

index 7743d91a061b7b9d4db7768d1f10ed5312de2835..8ead94c4016de6be1802a561c67dfa1c9cd1ae49 100755 (executable)
@@ -143,6 +143,7 @@ restore_normal_conf() {
 #------------------------------------------------------------------------------
 start_vpn() {
 
+    debug "Activating trap ..."
     trap restore_normal_conf INT TERM EXIT ABRT
 
     info "Enabling special ${CYAN}/etc/resolv.conf${NORMAL} by ${CYAN}${RESOLV_CONF_DPX}${NORMAL} ..."
@@ -152,6 +153,11 @@ start_vpn() {
     debug "Executing: ${cmd}"
     eval ${cmd}
 
+    debug "Deactivating trap ..."
+    trap - INT TERM EXIT ABRT
+
+    restore_normal_conf
+
 }
 
 #------------------------------------------------------------------------------
index 767201a9f90b44ae4ea9489d20e8f24bfb485a8f..6673068257d503a96cbf54ac5c3abb2377111078 100644 (file)
@@ -10,7 +10,7 @@ BLUE=""
 CYAN=""
 NORMAL=""
 
-VERSION="0.3.0"
+VERSION="0.3.1"
 
 STD_SHORT_OPTIONS="sdvhV"
 STD_LONG_OPTIONS="simulate,debug,verbose,nocolor,help,version"
@@ -299,6 +299,21 @@ RM() {
 
 }
 
+#------------------------------------------------------------------------------
+CP() {
+
+    if [[ "${SIMULATE}" == "y" ]] ; then
+        debug "Simulated copying of: $*"
+        return
+    fi
+    if [[ "${VERBOSE}" != "y" ]] ; then
+        cp "$@"
+    else
+        cp --verbose "$@"
+    fi
+
+}
+
 #------------------------------------------------------------------------------
 set_locale() {