summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-02-17 19:36:08 +0000
committerache <ache@FreeBSD.org>1996-02-17 19:36:08 +0000
commitad70e1021bed8085056f5a94778fddfb2a893198 (patch)
treeec59f6849de9a04f37c95ee83e68fb5e91bcbebc
parent11d43035a036520de406b386b2021248a5c83936 (diff)
downloadFreeBSD-src-ad70e1021bed8085056f5a94778fddfb2a893198.zip
FreeBSD-src-ad70e1021bed8085056f5a94778fddfb2a893198.tar.gz
-u unit-command example
-rwxr-xr-xshare/examples/slattach/unit-command.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/examples/slattach/unit-command.sh b/share/examples/slattach/unit-command.sh
new file mode 100755
index 0000000..9e97ffd
--- /dev/null
+++ b/share/examples/slattach/unit-command.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+old_unit=$1
+new_unit=$2
+
+if [ $old_unit != -1 ]; then
+ ifconfig sl$old_unit delete down
+ if [ $new_unit == -1 ]; then
+ route delete default
+ fi
+fi
+
+if [ $new_unit != -1 ]; then
+ ifconfig sl$new_unit <address1> <address2>
+ if [ $old_unit == -1 ]; then
+ route add default <address2>
+ fi
+fi
OpenPOWER on IntegriCloud