[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
-x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*}
+this_file="$(readlink -f -- "${BASH_SOURCE[0]}")"
+readonly this_file this_dir="${this_file%/*}"
+cd "$this_dir"
usage() {
- cat <<EOF
-usage: ${0##*/} [-h|--help] [HOST/IP] [wrt-setup-local_ARGS]
+ cat <<'EOF'
+usage: wrt-setup [-h|--help] [HOST/IP] [wrt-setup-local_ARGS]
setup my router in general: dhcp, dns, etc.
Default HOST is 10.0.0.1 or 10.2.0.1 if they are the gateway, otherwise
opkg install /root/bash_5.0-3_mips_24kc.ipk
EOF
wrt-setup-local -h
- exit $1
+ exit 0
}