14 Mar 2007 Çar tarihinde, Peter Jones şunları yazmıştı: > Yeah, I think that's the right idea, but I think the patch below is > slightly better (also untested!). > > BTW, isn't the $": blah blah blah" the right thing to do rather than > setting LC_ALL? > > Obviously not applied yet.
Attached one corrects restartservice part of your patch and it works well for me (tested) :) Cheers -- S.Çağlar Onur <[EMAIL PROTECTED]> http://cekirdek.pardus.org.tr/~caglar/ Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.39
diff -u -r1.39 functions
--- pm/functions 14 Mar 2007 15:37:04 -0000 1.39
+++ pm/functions 14 Mar 2007 16:24:40 -0000
@@ -174,6 +174,19 @@
return 0
}
+_service=$(type -p service)
+if [ -z "$_service" ]; then
+ service() {
+ if [ -x "/etc/init.d/$1" ]; then
+ "/etc/init.d/$@"
+ else
+ echo "$1" $": unrecognized service" 1>&2
+ return 1
+ fi
+ }
+fi
+unset _service
+
_rmmod() {
if modprobe -r $1; then
echo "export RESUME_MODULES=\"$1 \$RESUME_MODULES\"" \
@@ -232,19 +245,18 @@
stopservice()
{
service "$1" status 2>/dev/null | grep -c -q running
- if [ "$?" == "0" -a -x "/etc/init.d/$1" ]; then
+ if [ "$?" == "0" ]; then
N=${1//[_.]/_}
echo "export ${N}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
- "/etc/init.d/$1" stop 2>&1
+ service "$1" stop 2>&1
fi
}
restartservice()
{
N=${1//[-.]/_}
- if [ "x$(eval echo \$${N}_SERVICE_ACTIVATE)" == "xyes" \
- -a -x "/etc/init.d/$1" ]; then
- "/etc/init.d/$1" start 2>&1
+ if [ "x$(eval echo \$${N}_SERVICE_ACTIVATE)" == "xyes" ]; then
+ service "$1" start 2>&1
fi
}
pgpNJlZTaIDeM.pgp
Description: PGP signature
_______________________________________________ Pm-utils mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pm-utils
