#! /bin/sh #---------------------------------------------------------------------------------------- # eisfax - eisfax init script # # Last Update: $Id$ # # Copyright (c) 2003-2004 JED # Copyright (c) 2005 Frank Meyer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------------- # read eislib . /var/install/include/eislib abort=0 # read parameters if [ -f /etc/config.d/eisfax ] then . /etc/config.d/eisfax else mecho -error "/etc/config.d/eisfax does not exist!" abort=1 fi # check if inet config file exist, if yes -read it if [ -f /etc/config.d/inet ] then . /etc/config.d/inet else mecho -error "/etc/config.d/inet does not exist!" abort=1 fi # check if inetd has been enabled if [ "$START_XINETD" != "yes" ] then mecho -error "xinetd not enabled in /etc/config.d/inet!" abort=1 fi # check if inittab config file exist if [ ! -f /etc/inittab ] then mecho -error "/etc/inittab not found!" abort=1 fi # check if services file exist if [ ! -f /etc/services ] then mecho -error "/etc/services not found!" abort=1 fi #---------------------------------------------------------------------------------------- # start eisfax #---------------------------------------------------------------------------------------- eisfax_start () { rm -f /var/spool/fax/outgoing/faxrunqd.pid # get command line parameter cmdline="$1" if [ "$START_EISFAX" = "yes" -o "$cmdline" = "man" ] # start eisfax? then if [ "$cmdline" != "quiet" ] # quiet? then mecho -info "starting Eisfax ..." fi /var/install/config.d/eisfax.sh addinittab /var/install/config.d/eisfax.sh writevarrun fi } #---------------------------------------------------------------------------------------- # stop eisfax #---------------------------------------------------------------------------------------- eisfax_stop () { # get command line parameter cmdline="$1" if [ "$cmdline" != "quiet" ] # quiet? then mecho -info "stopping Eisfax ..." fi /var/install/config.d/eisfax.sh delinittab /var/install/config.d/eisfax.sh delvarrun } #---------------------------------------------------------------------------------------- # eisfax status #---------------------------------------------------------------------------------------- eisfax_status () { # get command line parameter cmdline="$1" ### status of VBox auto-start if [ "$cmdline" != "quiet" ] # quiet? then if [ "$START_EISFAX" = yes ] then mecho -info "Eisfax auto-start at boot-time: enabled" else mecho -error "Eisfax auto-start at boot-time: disabled" fi fi grep "^faxr" /etc/inittab|grep "respawn\|once" > /dev/null if [ "$?" = 0 ] then # fax receive daemon enabled mecho -info "Eisfax receive daemon: enabled" else mecho -error "Eisfax receive daemon: disabled" fi grep "^faxs" /etc/inittab|grep "respawn" > /dev/null if [ "$?" = 0 ] then # fax receive daemon enabled mecho -info "Eisfax send daemon: enabled" else mecho -error "Eisfax send daemon: disabled" fi } #========================================================================================= # main #========================================================================================= if [ $abort = 0 ] then case $1 in start) eisfax_start "$2" ;; stop) eisfax_stop "$2" ;; restart) eisfax_stop "$2" eisfax_start "$2" ;; reload) /sbin/init q > /dev/null ;; status) eisfax_status "$2" ;; *) # help echo "Usage: $0 {start} man - start manually" echo "Usage: $0 {start|stop|restart|reload|status} - start normal" echo "Usage: $0 {start|stop|restart|reload|status} quiet - start silently" ;; esac fi exit 0