summaryrefslogtreecommitdiff
path: root/scripts/vyatta-link-detect
blob: 8981d7f43dc97efe028d0f2ed40261fe28db1fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"