From 5f5e1c891cf2d03ae4642a78936a8e9ba2bf9ffb Mon Sep 17 00:00:00 2001 From: "Cameron (Kamran) Mashayekhi" Date: Thu, 27 Oct 2005 23:21:53 +0000 Subject: [PATCH] nomsg --- c_micasad/startup/micasad | 170 ++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 88 deletions(-) diff --git a/c_micasad/startup/micasad b/c_micasad/startup/micasad index 606e05e0..dff4f662 100644 --- a/c_micasad/startup/micasad +++ b/c_micasad/startup/micasad @@ -1,88 +1,82 @@ -#! /bin/sh -### BEGIN INIT INFO -#Default-Start: 1 2 3 5 -#Description: miCASA daemon -### END INIT INFO -MICASAD_BIN=/opt/novell/CASA/bin/micasad.sh -test -x $MICASAD_BIN || exit 5 - -. /etc/rc.status - -# Shell functions sourced from /etc/rc.status: -# rc_check check and set local and overall rc status -# rc_status check and set local and overall rc status -# rc_status -v ditto but be verbose in local rc status -# rc_status -v -r ditto and clear the local rc status -# rc_failed set local and overall rc status to failed -# rc_reset clear local rc status (overall remains) -# rc_exit exit appropriate to overall rc status - -# First reset status of this service -rc_reset - -case "$1" in - start) - echo -n "Starting miCASA daemon" - - for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm" - do - - if [ -f $name ] - then - awk ' - /auth/ { authSeen++; } - /account/ { - if (!acctSeen && authSeen) - { - print "auth\trequired\tpam_micasa.so\n";} - acctSeen++; - } -# /session/ { sesSeen++; } - // {print $0; } - END -# { if (sesSeen) -# print "session\trequired\tpam_micasa.so\n"; } - ' $file > $file.sav - mv $file.sav $file - fi - - startproc -f $MICASAD_BIN - - # Remember status and be verbose - rc_status -v - ;; - stop) - echo -n "Shutting miCASA daemon down" - - #killproc -TERM $MICASAD_BIN - pid=`cat /var/run/micasad.pid` - kill -s TERM $pid - - for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm" - do - if [ -f $name ] - then - sed '/pam_micasa/d' $file > $file.sav - mv $file.sav $file - fi - done - - # Remember status and be verbose - rc_status -v - ;; - restart) - ## Stop the service and regardless of whether it was - ## running or not, start it again. - echo -n "Restarting miCASA daemon" - $0 stop - $0 start - - # Remember status and be quiet - rc_status - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 - ;; -esac -rc_exit +#! /bin/sh +### BEGIN INIT INFO +#Default-Start: 1 2 3 5 +#Description: miCASA daemon +### END INIT INFO +MICASAD_BIN=/opt/novell/CASA/bin/micasad.sh +test -x $MICASAD_BIN || exit 5 + +. /etc/rc.status + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_failed set local and overall rc status to failed +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status + +# First reset status of this service +rc_reset + +case "$1" in + start) + echo -n "Starting miCASA daemon" + for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm" + do + if [ -f $name ] + then + awk ' + /auth/ { authSeen++; } + /account/ { + if (!acctSeen && authSeen) + { + print "auth\trequired\tpam_micasa.so\n";} + acctSeen++; + } + /session/ { sesSeen++; } + // {print $0; } + END { if (sesSeen) + print "session\trequired\tpam_micasa.so\n"; } + ' $file > $file.sav + mv $file.sav $file + fi + done + startproc -f $MICASAD_BIN + # Remember status and be verbose + rc_status -v + ;; + stop) + echo -n "Shutting miCASA daemon down" + #killproc -TERM $MICASAD_BIN + pid=`cat /var/run/micasad.pid` + kill -s TERM $pid + + for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm" + do + if [ -f $name ] + then + sed '/pam_micasa/d' $file > $file.sav + mv $file.sav $file + fi + done + # Remember status and be verbose + rc_status -v + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + echo -n "Restarting miCASA daemon" + $0 stop + $0 start + + # Remember status and be quiet + rc_status + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +rc_exit