17 |
|
|
18 |
COLUMNS=$(stty size) |
COLUMNS=$(stty size) |
19 |
COLUMNS=${COLUMNS##* } |
COLUMNS=${COLUMNS##* } |
20 |
|
if [[ -z ${COLUMNS} ]] || [[ ${COLUMNS} = 0 ]] |
21 |
|
then |
22 |
|
COLUMNS=80 |
23 |
|
fi |
24 |
COL=$[ $COLUMNS - 10 ] |
COL=$[ $COLUMNS - 10 ] |
25 |
WCOL=$[ $COLUMNS - 30 ] |
WCOL=$[ $COLUMNS - 30 ] |
26 |
WWCOL=$[ $COLUMNS - 40 ] |
WWCOL=$[ $COLUMNS - 40 ] |
51 |
svcfstype="tmpfs" |
svcfstype="tmpfs" |
52 |
svcsize=1024 |
svcsize=1024 |
53 |
|
|
54 |
|
rc_echo() { echo "$@"; } |
55 |
|
rc_print() { rc_echo -e "${COLOREDSTAR}$@"; } |
56 |
|
|
57 |
# dummy function; needed if splashutils are not installed |
# dummy function; needed if splashutils are not installed |
58 |
splash() { return 0; } |
splash() { return 0; } |
145 |
print_status success |
print_status success |
146 |
else |
else |
147 |
print_status failure |
print_status failure |
148 |
|
|
149 |
|
if [[ ${SPLASH_VERBOSE_ON_ERRORS} = 1 ]] |
150 |
|
then |
151 |
|
splash "rc_verbose" "${runlevel}" |
152 |
|
fi |
153 |
fi |
fi |
154 |
|
|
155 |
return ${error_value} |
return ${error_value} |
207 |
|
|
208 |
getpids() |
getpids() |
209 |
{ |
{ |
210 |
base=${1##*/} |
local base=${1##*/} |
211 |
pidlist=$(pidof -o $$ -o $PPID -x $base) |
local opts |
212 |
|
if [[ $(readlink /bin/pidof) = *busybox ]] |
213 |
|
then |
214 |
|
opts="" |
215 |
|
else |
216 |
|
opts="-x" |
217 |
|
fi |
218 |
|
pidlist=$(pidof -o $$ -o $PPID ${opts} $base) |
219 |
} |
} |
220 |
|
|
221 |
loadproc() |
loadproc() |
277 |
done |
done |
278 |
|
|
279 |
base=${1##*/} |
base=${1##*/} |
280 |
if [ $failure = 0 ]; then rm -f /var/run/$base.pid; fi |
if [ $failure = 0 ]; then rm -f /run/$base.pid; fi |
281 |
|
|
282 |
(exit $failure) |
(exit $failure) |
283 |
evaluate_retval |
evaluate_retval |
336 |
then |
then |
337 |
echo "$base is running with Process ID(s) $pidlist" |
echo "$base is running with Process ID(s) $pidlist" |
338 |
else |
else |
339 |
if [ -s /var/run/$base.pid ] |
if [ -s /run/$base.pid ] |
340 |
then |
then |
341 |
echo "$1 is not running but /var/run/$base.pid exists" |
echo "$1 is not running but /run/$base.pid exists" |
342 |
return 1 |
return 1 |
343 |
else |
else |
344 |
echo "$1 is not running" |
echo "$1 is not running" |
471 |
|
|
472 |
return 1 |
return 1 |
473 |
} |
} |
474 |
|
|
475 |
|
# read /etc/os-release file |
476 |
|
# read_os_release $item |
477 |
|
read_os_release() |
478 |
|
{ |
479 |
|
local NAME |
480 |
|
local ID |
481 |
|
local Version |
482 |
|
local Version_ID |
483 |
|
local PRETTY_NAME |
484 |
|
local ANSI_COLOR |
485 |
|
local CPE_NAME |
486 |
|
|
487 |
|
if [[ -f /etc/os-release ]] |
488 |
|
then |
489 |
|
source /etc/os-release |
490 |
|
|
491 |
|
case $1 in |
492 |
|
name) echo "${NAME}" ;; |
493 |
|
id) echo "${ID}" ;; |
494 |
|
version) echo "${Version}" ;; |
495 |
|
version_id) echo "${Version_ID}" ;; |
496 |
|
pretty_name) echo "${PRETTY_NAME}" ;; |
497 |
|
ansi_color) echo "${ANSI_COLOR}" ;; |
498 |
|
cpe_name) echo "${CPE_NAME}" ;; |
499 |
|
esac |
500 |
|
fi |
501 |
|
} |
502 |
|
|
503 |
|
start_devicemanager() { touch /dev/.none; return 0; } |
504 |
|
stop_devicemanager() { return 0; } |