Accept a name for dl and include starter script file
[khome.git] / home / bin / resolv
CommitLineData
0152c91e
SK
1#! /bin/sh
2
3FILE='/etc/resolv.conf'
4CONTENT=\
5'nameserver 167.206.13.180
6nameserver 167.206.13.181
7nameserver 192.168.1.1'
8
9uncommented() {
10 echo "$CONTENT"
11}
12
13commented() {
14 for line in "$CONTENT"
15 do
16 echo "$line" | sed 's/^/#/'
17 done
18}
19
20switch_on() {
21 chattr -i "$FILE" # Make mutable
22 rm -f "$FILE"
23 uncommented > "$FILE"
24 chmod a+r "$FILE"
25}
26
27switch_off() {
28 rm -f "$FILE"
29 commented > "$FILE"
30 chmod a-rw "$FILE"
31 chattr +i "$FILE" # Make immutable
32}
33
34case "$1" in
35 'on' ) switch_on;;
36 'off') switch_off;;
37 '')
38 echo "usage: $0 SWITCH\n\nSWITCH = on | off"
39 exit 1;;
40esac
This page took 0.074096 seconds and 4 git commands to generate.