slitaz-base-files view rootfs/etc/init.d/rc.functions @ rev 335

Add Italian; make pot; make msgmerge; make clean
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jan 30 11:11:43 2018 +0200 (2018-01-30)
parents 78038351c7c8
children
line source
1 #!/bin/sh
2 # /etc/init.d/rc.functions: SliTaz boot scripts functions.
3 #
5 . /lib/libtaz.sh
7 # Check daemon with pidfile: usage check_pidfile $PIDFILE $DAEMON
8 active_pidfile() {
9 if [ ! -e $1 ]; then
10 return 1
11 elif grep -qs "Name:.$(basename $2)$" \
12 /proc/$(sed 's/[^0-9]//g;q' $1)/status; then
13 return 0
14 else
15 rm -f $1
16 return 2
17 fi
18 }
20 # Get specified cmdline option value
21 cmdline_option() {
22 local opt
23 for opt in $(cat /proc/cmdline); do
24 case $opt in
25 $1=*) echo ${opt#$1=};;
26 $1) echo yes;;
27 esac
28 done
29 }