Restructure directory layout
To make this better than the unorganized mess it used to be.
This commit is contained in:
parent
58a36ed632
commit
c4f7279f2e
25 changed files with 0 additions and 727 deletions
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
NETWORKMANAGER_NETCONFIG="/var/run/netconfig/NetworkManager.netconfig"
|
||||
|
||||
dns-update() {
|
||||
tmpfile=$(mktemp)
|
||||
sed --regexp-extended "s/(DNSSERVERS=)'(.*?)'/\1'$@ \2'/g" "${NETWORKMANAGER_NETCONFIG}" > "${tmpfile}"
|
||||
netconfig modify -s NetworkManager -I "${tmpfile}"
|
||||
rm -f "${tmpfile}"
|
||||
}
|
||||
|
||||
dns-restore() {
|
||||
tmpfile=$(mktemp)
|
||||
sed --regexp-extended "s/$@ //g" "${NETWORKMANAGER_NETCONFIG}" > "${tmpfile}"
|
||||
netconfig modify -s NetworkManager -I ${tmpfile}
|
||||
rm -f ${tmpfile}
|
||||
}
|
||||
|
||||
dns() {
|
||||
local cmdname=$1; shift
|
||||
"dns-$cmdname" "$@"
|
||||
}
|
||||
|
||||
if declare -f "$1" >/dev/null 2>&1; then
|
||||
# invoke that function, passing arguments through
|
||||
"$@" # same as "$1" "$2" "$3" ... for full argument list
|
||||
else
|
||||
echo "Function $1 not recognized" >&2
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue