X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=host.init;fp=host.init;h=0c2a91431b859d2a5db781986ce0dd3666eab699;hb=106e14d7f661da956715e6898cbfeff512744b28;hp=62aeed4fb78eb1d7315069672d02dab74c11db2e;hpb=ef7a909a625a7f643c5fc78afac5c6150a265252;p=myplc.git diff --git a/host.init b/host.init index 62aeed4..0c2a914 100755 --- a/host.init +++ b/host.init @@ -6,7 +6,7 @@ # # description: Manages all PLC services on this machine # -# $Id: host.init,v 1.8 2006/07/06 17:43:52 mlhuang Exp $ +# $Id: host.init,v 1.9 2006/07/17 21:30:33 mlhuang Exp $ # PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -29,8 +29,12 @@ if ! type -type success >/dev/null || ! type -type failure >/dev/null ; then fi # Source configuration -if [ -f /etc/sysconfig/plc -a -z "${PLC_ROOT}${PLC_DATA}" ] ; then - . /etc/sysconfig/plc +SERVICE=$(basename $0) +if [ ! -f /etc/sysconfig/$SERVICE ] ; then + SERVICE=plc +fi +if [ -f /etc/sysconfig/$SERVICE -a -z "${PLC_ROOT}${PLC_DATA}" ] ; then + . /etc/sysconfig/$SERVICE fi # Total number of errors @@ -141,12 +145,16 @@ case "$command" in start $* ;; + reload) + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS reload $* + ;; + mount|umount|mountstatus) ${command}_plc $* ;; *) - echo "Usage: $0 {start|stop|restart|mount|umount|mountstatus}" + echo "Usage: $0 {start|stop|restart|reload|mount|umount|mountstatus}" RETVAL=1 ;; esac