mirror of
https://github.com/gentoo-mirror/gentoo-zh.git
synced 2025-04-10 20:08:43 -04:00
55 lines
1.0 KiB
Plaintext
55 lines
1.0 KiB
Plaintext
#!/sbin/runscript
|
|
# Copyright 1999-2008 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /etc/init.d/ruijie$
|
|
|
|
#depend() {
|
|
#
|
|
#}
|
|
checkconfig() {
|
|
if [ ! -f "/etc/xmuruijie.conf" ] ; then
|
|
eerror "You must set configs in /etc/xmuruijie.conf first"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
DEV=$(sed -n '/interface/p' /etc/xmuruijie.conf | awk '{print $2}')
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
|
|
ebegin "Starting XMU-Ruijie"
|
|
/usr/sbin/xmuruijie -dD
|
|
eend $?
|
|
ebegin "Running dhcp client to get ip address"
|
|
if [ -f "/sbin/dhcpcd" ] ; then
|
|
/sbin/dhcpcd ${DEV}
|
|
elif [ -f "/sbin/dhclient" ] ; then
|
|
/sbin/dhclient ${DEV}
|
|
fi
|
|
eend $?
|
|
ebegin "Modify firewall rules"
|
|
/etc/init.d/localip restart
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Modify firewall rules"
|
|
/etc/init.d/localip stop
|
|
eend $?
|
|
ebegin "Stopping dhcp client"
|
|
if [ -f "/sbin/dhcpcd" ] ; then
|
|
/sbin/dhcpcd -k ${DEV}
|
|
elif [ -f "/sbin/dhclient" ] ; then
|
|
/sbin/dhclient -r ${DEV}
|
|
fi
|
|
eend $?
|
|
ebegin "Stopping XMU-Ruijie"
|
|
/usr/sbin/xmuruijie -p
|
|
eend $?
|
|
}
|
|
#
|
|
#restart() {
|
|
#
|
|
#}
|