connman: start init scripts on RUNLEVEL=boot

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-09-07 23:10:05 +02:00
parent e78b76d1e2
commit 0946759631

View File

@ -22,28 +22,30 @@
#
# runlevels: openelec, installer, textmode
if [ -f /var/config/settings.conf ]; then
case $RUNLEVEL in
boot)
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
# save original interface names (eth0, eth1)
# save original interface names (eth0, eth1)
NET_IFACE_NAME=$NET_IFACE
NET2_IFACE_NAME=$NET2_IFACE
fi
fi
[ -z "$NET_HOSTNAME" ] && NET_HOSTNAME="openelec"
[ -z "$NET_HOSTNAME" ] && NET_HOSTNAME="openelec"
# setup hostname
# setup hostname
progress "Setup hostname"
echo "$NET_HOSTNAME" > /proc/sys/kernel/hostname
# create /etc/hosts file, useful for gethostbyname(localhost)
# create /etc/hosts file, useful for gethostbyname(localhost)
progress "creating /etc/hosts"
echo -e "127.0.0.1\tlocalhost $NET_HOSTNAME" > /etc/hosts
# add user defined hosts.conf entry's
# add user defined hosts.conf entry's
[ -f $HOME/.config/hosts.conf ] && cat $HOME/.config/hosts.conf >> /etc/hosts
(
(
# setup Networking 1
progress "setup Networking 1"
@ -168,7 +170,7 @@ fi
[ -n "$NET2_DNS3" ] && NET2_NAMESERVER="$NET2_NAMESERVER;$NET2_DNS3"
[ -n "$NET2_NAMESERVER" ] && echo "Nameservers=$NET2_NAMESERVER;" >> $CONNMAN_PROFILE
(
(
# wait some time, put eth1 (NET2_IFACE) down and then up
# this is just temporary solution until I figure out how to
# do properly with connman
@ -176,7 +178,7 @@ fi
ifconfig $NET2_IFACE_NAME down
usleep 1000000
ifconfig $NET2_IFACE_NAME up
)&
)&
fi
# END OF NETWORK 2
@ -193,4 +195,9 @@ fi
/usr/sbin/connmand -n > /dev/null 2>&1
usleep 250000
done
)&
)&
;;
poweroff|reboot)
;;
esac