Hi;

Attached patch adds Pardus [1] support into helper functions stopservice and 
restartservice.

[1] http://www.pardus.org.tr/eng/index.html

Cherrs
-- 
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.32
diff -u -r1.32 functions
--- pm/functions	30 Nov 2006 20:07:04 -0000	1.32
+++ pm/functions	13 Jan 2007 01:02:05 -0000
@@ -1,6 +1,8 @@
 #!/bin/bash
 
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin
+# To get rid of localized outputs
+export LC_ALL=C
 
 # Default values go here.  It is important to _not_ initialize some
 # variables here.  They are:
@@ -212,18 +214,30 @@
 
 stopservice()
 {
-	service "$1" status 2>/dev/null | grep -c -q running
-	if [ "$?" == "0" -a -x "/etc/init.d/$1" ]; then
+	if [ -f /etc/pardus-release ]; then
+		service "$1" info | grep -c -q running
+	else
+		service "$1" status 2>/dev/null | grep -c -q running
+	fi
+
+	if [ "$?" == "0" ]; then
 		echo "export ${1}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
-		"/etc/init.d/$1" stop 2>&1
+		if [ -x "/etc/init.d/$1" ]; then
+			"/etc/init.d/$1" stop 2>&1
+		elif [ -f /etc/pardus-release ]; then
+			service "$1" stop 2>&1
+		fi
 	fi
 }
 
 restartservice()
 {
-	if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" \
-			-a -x "/etc/init.d/$1" ]; then
-		"/etc/init.d/$1" start 2>&1
+	if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" ]; then
+		if [ -x "/etc/init.d/$1" ]; then
+			"/etc/init.d/$1" start 2>&1
+		elif [ -f /etc/pardus-release ]; then
+			service "$1" start 2>&1
+		fi
 	fi
 }
 

Attachment: pgp475VZ0lbY9.pgp
Description: PGP signature

_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to