mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
-u unit-command example
This commit is contained in:
parent
438a2cf9d4
commit
de057eb654
1 changed files with 18 additions and 0 deletions
18
share/examples/slattach/unit-command.sh
Executable file
18
share/examples/slattach/unit-command.sh
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue