23 |
{ |
{ |
24 |
local value="$1" |
local value="$1" |
25 |
local CONFIG |
local CONFIG |
26 |
|
local socket |
27 |
|
local cookie |
28 |
|
local authtype |
29 |
|
|
30 |
[[ -z ${value} ]] && help_network_hostname && return 1 |
[[ -z ${value} ]] && help_network_hostname && return 1 |
31 |
|
|
32 |
CONFIG="/etc/hostname" |
CONFIG="/etc/hostname" |
33 |
clearconfig |
clearconfig |
34 |
addconfig "${value}" |
addconfig "${value}" |
35 |
hostname "${value}" |
hostname "${value}" |
36 |
|
|
37 |
|
# check for running x11 and recreate the xauth cookie with the correct hostname |
38 |
|
if [[ ! -z $(pidof X) ]] |
39 |
|
then |
40 |
|
socket="${value}/unix${MCORE_XORG_DISPLAY}" |
41 |
|
cookie=$(x11runas "xauth list | sed 's:.*\ \(.*\):\1:'") |
42 |
|
authtype="MIT-MAGIC-COOKIE-1" |
43 |
|
# add the new hostname to the xauthority file |
44 |
|
x11runas "xauth add ${socket} ${authtype} ${cookie}" |
45 |
|
fi |
46 |
} |
} |
47 |
|
|
48 |
help_network_iface() |
help_network_iface() |
144 |
mecho "get network.nameserver" |
mecho "get network.nameserver" |
145 |
mecho " displays the current nameserver of the system" |
mecho " displays the current nameserver of the system" |
146 |
mecho |
mecho |
147 |
mecho "set network.dns [ip1] [ip2] .. [ipN]" |
mecho "set network.nameserver [ip1] [ip2] .. [ipN]" |
148 |
mecho " adds given ips as nameserver to the system" |
mecho " adds given ips as nameserver to the system" |
149 |
} |
} |
150 |
|
|