]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Add run_pre_up/run_pre_down
authorMariusz Mazur <mmazur@axeos.com>
Mon, 22 Aug 2016 10:34:00 +0000 (10:34 +0000)
committerMariusz Mazur <mmazur@axeos.com>
Mon, 22 Aug 2016 10:34:00 +0000 (10:34 +0000)
lib/ifdown
lib/ifup
sysconfig/interfaces/ifcfg-description

index 73df49060c9d023dd6f36bea0be1db6e2280f57f..75f6e5b749408a320a625048df50bfe1b45a1352 100755 (executable)
@@ -3,6 +3,8 @@
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
+run_pre_down() { :; }
+
 . /etc/sysconfig/network
 . /etc/rc.d/init.d/functions
 . /lib/rc-scripts/functions.network
@@ -43,6 +45,9 @@ source_config
 # set all major variables
 setup_ip_param
 
+# anything you need done first
+run_pre_down
+
 OTHERSCRIPT="/lib/rc-scripts/ifdown-${DEVICETYPE}"
 
 # shutdown tleds software
index c53444235e1b2f49ee6c3cbdc073e686e48afa35..cac60cff7047e24d4377458df7ceee09b74bc87d 100755 (executable)
--- a/lib/ifup
+++ b/lib/ifup
@@ -3,6 +3,8 @@
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
+run_pre_up() { :; }
+
 . /etc/sysconfig/network
 . /etc/rc.d/init.d/functions
 . /lib/rc-scripts/functions.network
@@ -65,6 +67,9 @@ setup_ip_param
 
 SYSCTLDEVICE=$(echo ${DEVICE} | sed 's/\./\//g')
 
+# anything you need done first
+run_pre_up
+
 OTHERSCRIPT="/lib/rc-scripts/ifup-${DEVICETYPE}"
 
 if [ -x "$OTHERSCRIPT" ]; then
index 3986ef9dd8ea85a76a39b2f7b8795b20c36ef89c..967b51eddb44480c308219002972a721be66a2ff 100644 (file)
@@ -227,13 +227,23 @@ elif    DEVICE=irda* ; then     /* IrDA */
         DISCOVERY=yes|no (starts discovery of remote IrDA devices)
 fi
 
-# You can also run some other programs *after* device has been brought up or down.
-# Just create functions run_up() and run_down().
+# You can also run commands before/after a device has been brought up or down.
+# Just create functions run_up/run_pre_up/run_down/run_pre_down.
+run_pre_up()
+{
+       echo "This will be executed before device is brought up!"
+}
+
 run_up()
 {
        echo "This will be executed after device is brought up!"
 }
 
+run_pre_down()
+{
+       echo "This will be executed before device is brought down!"
+}
+
 run_down()
 {
        echo "This will be executed after device is brought down!"
This page took 0.653312 seconds and 4 git commands to generate.