diff options
Diffstat (limited to 'scripts/vyatta-link-detect')
-rwxr-xr-x | scripts/vyatta-link-detect | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/vyatta-link-detect b/scripts/vyatta-link-detect new file mode 100755 index 00000000..8981d7f4 --- /dev/null +++ b/scripts/vyatta-link-detect @@ -0,0 +1,21 @@ +#! /bin/bash +# +# Usage: vyatta-link-detect devicename on|off +# + +usage() { + echo "Usage: $0 devicename {on|off}" + exit 1 +} + +if [ $# -ne 2 ]; then + usage +fi + +case $2 in +on) cmd="link-detect" ;; +off) cmd="no link-detect" ;; +*) usage;; +esac + +exec vyatta-vtysh -c "configure terminal" -c "interface $1" -c "$cmd" |