blob: 78f71443ed0179b0313c26fdf342a5cca1d1bb3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
default_dev='wlan0=funston'
die() { printf 'Error: %s\n' "$*" >&2; exit 1; }
with_pwd_path()
{
local PATH="$PATH":.
"$@"
}
[ $(id -u) = 0 ] || die "you are not root."
restart=$(with_pwd_path which restart-linux-device) || die "command 'restart-linux-device' is not available."
dev=${1:-$default_dev}
rawdev=${dev%=*}
[ "$VERBOSE" ] && set -x
$restart $rawdev
ifdown --force $rawdev # It's not clear to me why this is necessary, but it is.
ifup $dev
|