fix network config

This commit is contained in:
gh2o 2014-07-13 17:06:54 -07:00
parent 9ffe73e4a9
commit 7c5e1fb585
1 changed files with 12 additions and 3 deletions

View File

@ -310,11 +310,18 @@ postinstall_main() {
rm /etc/shadow.new rm /etc/shadow.new
# set up network # set up network
local grepfd
local ipaddr netmask gateway prefixlen=24 local ipaddr netmask gateway prefixlen=24
local oldeni=/oldroot/etc/network/interfaces local oldeni=/oldroot/etc/network/interfaces
grep -o 'address [0-9.]\+' ${oldeni} | read ignored ipaddr exec {grepfd}< <(
grep -o 'netmask [0-9.]\+' ${oldeni} | read ignored netmask grep -o 'address [0-9.]\+' ${oldeni}
grep -o 'gateway [0-9.]\+' ${oldeni} | read ignored gateway grep -o 'netmask [0-9.]\+' ${oldeni}
grep -o 'gateway [0-9.]\+' ${oldeni}
)
read ignored ipaddr <&${grepfd}
read ignored netmask <&${grepfd}
read ignored gateway <&${grepfd}
exec {grepfd}<&-
case ${netmask} in case ${netmask} in
255.255.255.0) 255.255.255.0)
prefixlen=24 prefixlen=24
@ -336,6 +343,8 @@ Gateway=${gateway}
DNS=8.8.8.8 DNS=8.8.8.8
DNS=8.8.4.4 DNS=8.8.4.4
EOF EOF
systemctl enable systemd-networkd
systemctl start systemd-networkd
# enable ssh # enable ssh
systemctl enable sshd systemctl enable sshd