slitaz-boot-scripts view etc/init.d/rc.functions @ rev 262

Improve, fixes, big changes, 2 scripts less, one new system.sh, GUI config in live tha work with latest cookutils packages, well tested on Qemu, frugal, first HD install boot
author Christophe Lincoln <pankso@slitaz.org>
date Mon May 16 00:32:16 2011 +0200 (2011-05-16)
parents 05ced4fe03dd
children
line source
1 #!/bin/sh
2 # /etc/init.d/rc.functions: SliTaz boot scripts functions.
3 #
5 # Status functions.
6 status() {
7 echo -en "\\033[70G[ "
8 if [ $? = 0 ]; then
9 echo -en "\\033[1;32mOK"
10 else
11 echo -en "\\033[1;31mFailed"
12 fi
13 echo -e "\\033[0;39m ]"
14 }
16 # Check daemon with pidfile: usage check_pidfile $PIDFILE $DAEMON
17 active_pidfile()
18 {
19 if [ ! -e $1 ]; then
20 return 1
21 elif grep -qs "Name:.$(basename $2)$" \
22 /proc/$(sed 's/[^0-9]//g' < $1 | head -n 1)/status ; then
23 return 0
24 else
25 rm -f $1
26 return 2
27 fi
28 }