source: bootscripts/lfs/lib/services/init-functions@ d83fd51

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since d83fd51 was b7804ae, checked in by Bruce Dubbs <bdubbs@…>, 9 years ago

Cosmetic changes to output messages by network boot scripts.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10858 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 28.9 KB
Line 
1#!/bin/sh
2########################################################################
3#
4# Begin /lib/lsb/init-funtions
5#
6# Description : Run Level Control Functions
7#
8# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
9# : DJ Lucas - dj@linuxfromscratch.org
10# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
11#
12# Version : LFS 7.0
13#
14# Notes : With code based on Matthias Benkmann's simpleinit-msb
15# http://winterdrache.de/linux/newboot/index.html
16#
17# The file should be located in /lib/lsb
18#
19########################################################################
20
21## Environmental setup
22# Setup default values for environment
23umask 022
24export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
25
26## Set color commands, used via echo
27# Please consult `man console_codes for more information
28# under the "ECMA-48 Set Graphics Rendition" section
29#
30# Warning: when switching from a 8bit to a 9bit font,
31# the linux console will reinterpret the bold (1;) to
32# the top 256 glyphs of the 9bit font. This does
33# not affect framebuffer consoles
34
35NORMAL="\\033[0;39m" # Standard console grey
36SUCCESS="\\033[1;32m" # Success is green
37WARNING="\\033[1;33m" # Warnings are yellow
38FAILURE="\\033[1;31m" # Failures are red
39INFO="\\033[1;36m" # Information is light cyan
40BRACKET="\\033[1;34m" # Brackets are blue
41
42# Use a colored prefix
43BMPREFIX=" "
44SUCCESS_PREFIX="${SUCCESS} * ${NORMAL}"
45FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
46WARNING_PREFIX="${WARNING} *** ${NORMAL}"
47SKIP_PREFIX="${INFO} S ${NORMAL}"
48
49SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
50FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
51WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
52SKIP_SUFFIX="${BRACKET}[${INFO} SKIP ${BRACKET}]${NORMAL}"
53
54BOOTLOG=/run/bootlog
55KILLDELAY=3
56
57# Set any user specified environment variables e.g. HEADLESS
58[ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site
59
60## Screen Dimensions
61# Find current screen size
62if [ -z "${COLUMNS}" ]; then
63 COLUMNS=$(stty size)
64 COLUMNS=${COLUMNS##* }
65fi
66
67# When using remote connections, such as a serial port, stty size returns 0
68if [ "${COLUMNS}" = "0" ]; then
69 COLUMNS=80
70fi
71
72## Measurements for positioning result messages
73COL=$((${COLUMNS} - 8))
74WCOL=$((${COL} - 2))
75
76## Set Cursor Position Commands, used via echo
77SET_COL="\\033[${COL}G" # at the $COL char
78SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
79CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
80CURS_ZERO="\\033[0G"
81
82################################################################################
83# start_daemon() #
84# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
85# #
86# Purpose: This runs the specified program as a daemon #
87# #
88# Inputs: -f: (force) run the program even if it is already running. #
89# -n nicelevel: specify a nice level. See 'man nice(1)'. #
90# -p pidfile: use the specified file to determine PIDs. #
91# pathname: the complete path to the specified program #
92# args: additional arguments passed to the program (pathname) #
93# #
94# Return values (as defined by LSB exit codes): #
95# 0 - program is running or service is OK #
96# 1 - generic or unspecified error #
97# 2 - invalid or excessive argument(s) #
98# 5 - program is not installed #
99################################################################################
100start_daemon()
101{
102 local force=""
103 local nice="0"
104 local pidfile=""
105 local pidlist=""
106 local retval=""
107
108 # Process arguments
109 while true
110 do
111 case "${1}" in
112
113 -f)
114 force="1"
115 shift 1
116 ;;
117
118 -n)
119 nice="${2}"
120 shift 2
121 ;;
122
123 -p)
124 pidfile="${2}"
125 shift 2
126 ;;
127
128 -*)
129 return 2
130 ;;
131
132 *)
133 program="${1}"
134 break
135 ;;
136 esac
137 done
138
139 # Check for a valid program
140 if [ ! -e "${program}" ]; then return 5; fi
141
142 # Execute
143 if [ -z "${force}" ]; then
144 if [ -z "${pidfile}" ]; then
145 # Determine the pid by discovery
146 pidlist=`pidofproc "${1}"`
147 retval="${?}"
148 else
149 # The PID file contains the needed PIDs
150 # Note that by LSB requirement, the path must be given to pidofproc,
151 # however, it is not used by the current implementation or standard.
152 pidlist=`pidofproc -p "${pidfile}" "${1}"`
153 retval="${?}"
154 fi
155
156 # Return a value ONLY
157 # It is the init script's (or distribution's functions) responsibilty
158 # to log messages!
159 case "${retval}" in
160
161 0)
162 # Program is already running correctly, this is a
163 # successful start.
164 return 0
165 ;;
166
167 1)
168 # Program is not running, but an invalid pid file exists
169 # remove the pid file and continue
170 rm -f "${pidfile}"
171 ;;
172
173 3)
174 # Program is not running and no pidfile exists
175 # do nothing here, let start_deamon continue.
176 ;;
177
178 *)
179 # Others as returned by status values shall not be interpreted
180 # and returned as an unspecified error.
181 return 1
182 ;;
183 esac
184 fi
185
186 # Do the start!
187 nice -n "${nice}" "${@}"
188}
189
190################################################################################
191# killproc() #
192# Usage: killproc [-p pidfile] pathname [signal] #
193# #
194# Purpose: Send control signals to running processes #
195# #
196# Inputs: -p pidfile, uses the specified pidfile #
197# pathname, pathname to the specified program #
198# signal, send this signal to pathname #
199# #
200# Return values (as defined by LSB exit codes): #
201# 0 - program (pathname) has stopped/is already stopped or a #
202# running program has been sent specified signal and stopped #
203# successfully #
204# 1 - generic or unspecified error #
205# 2 - invalid or excessive argument(s) #
206# 5 - program is not installed #
207# 7 - program is not running and a signal was supplied #
208################################################################################
209killproc()
210{
211 local pidfile
212 local program
213 local prefix
214 local progname
215 local signal="-TERM"
216 local fallback="-KILL"
217 local nosig
218 local pidlist
219 local retval
220 local pid
221 local delay="30"
222 local piddead
223 local dtime
224
225 # Process arguments
226 while true; do
227 case "${1}" in
228 -p)
229 pidfile="${2}"
230 shift 2
231 ;;
232
233 *)
234 program="${1}"
235 if [ -n "${2}" ]; then
236 signal="${2}"
237 fallback=""
238 else
239 nosig=1
240 fi
241
242 # Error on additional arguments
243 if [ -n "${3}" ]; then
244 return 2
245 else
246 break
247 fi
248 ;;
249 esac
250 done
251
252 # Check for a valid program
253 if [ ! -e "${program}" ]; then return 5; fi
254
255 # Check for a valid signal
256 check_signal "${signal}"
257 if [ "${?}" -ne "0" ]; then return 2; fi
258
259 # Get a list of pids
260 if [ -z "${pidfile}" ]; then
261 # determine the pid by discovery
262 pidlist=`pidofproc "${1}"`
263 retval="${?}"
264 else
265 # The PID file contains the needed PIDs
266 # Note that by LSB requirement, the path must be given to pidofproc,
267 # however, it is not used by the current implementation or standard.
268 pidlist=`pidofproc -p "${pidfile}" "${1}"`
269 retval="${?}"
270 fi
271
272 # Return a value ONLY
273 # It is the init script's (or distribution's functions) responsibilty
274 # to log messages!
275 case "${retval}" in
276
277 0)
278 # Program is running correctly
279 # Do nothing here, let killproc continue.
280 ;;
281
282 1)
283 # Program is not running, but an invalid pid file exists
284 # Remove the pid file.
285 rm -f "${pidfile}"
286
287 # This is only a success if no signal was passed.
288 if [ -n "${nosig}" ]; then
289 return 0
290 else
291 return 7
292 fi
293 ;;
294
295 3)
296 # Program is not running and no pidfile exists
297 # This is only a success if no signal was passed.
298 if [ -n "${nosig}" ]; then
299 return 0
300 else
301 return 7
302 fi
303 ;;
304
305 *)
306 # Others as returned by status values shall not be interpreted
307 # and returned as an unspecified error.
308 return 1
309 ;;
310 esac
311
312 # Perform different actions for exit signals and control signals
313 check_sig_type "${signal}"
314
315 if [ "${?}" -eq "0" ]; then # Signal is used to terminate the program
316
317 # Account for empty pidlist (pid file still exists and no
318 # signal was given)
319 if [ "${pidlist}" != "" ]; then
320
321 # Kill the list of pids
322 for pid in ${pidlist}; do
323
324 kill -0 "${pid}" 2> /dev/null
325
326 if [ "${?}" -ne "0" ]; then
327 # Process is dead, continue to next and assume all is well
328 continue
329 else
330 kill "${signal}" "${pid}" 2> /dev/null
331
332 # Wait up to ${delay}/10 seconds to for "${pid}" to
333 # terminate in 10ths of a second
334
335 while [ "${delay}" -ne "0" ]; do
336 kill -0 "${pid}" 2> /dev/null || piddead="1"
337 if [ "${piddead}" = "1" ]; then break; fi
338 sleep 0.1
339 delay="$(( ${delay} - 1 ))"
340 done
341
342 # If a fallback is set, and program is still running, then
343 # use the fallback
344 if [ -n "${fallback}" -a "${piddead}" != "1" ]; then
345 kill "${fallback}" "${pid}" 2> /dev/null
346 sleep 1
347 # Check again, and fail if still running
348 kill -0 "${pid}" 2> /dev/null && return 1
349 fi
350 fi
351 done
352 fi
353
354 # Check for and remove stale PID files.
355 if [ -z "${pidfile}" ]; then
356 # Find the basename of $program
357 prefix=`echo "${program}" | sed 's/[^/]*$//'`
358 progname=`echo "${program}" | sed "s@${prefix}@@"`
359
360 if [ -e "/var/run/${progname}.pid" ]; then
361 rm -f "/var/run/${progname}.pid" 2> /dev/null
362 fi
363 else
364 if [ -e "${pidfile}" ]; then rm -f "${pidfile}" 2> /dev/null; fi
365 fi
366
367 # For signals that do not expect a program to exit, simply
368 # let kill do its job, and evaluate kill's return for value
369
370 else # check_sig_type - signal is not used to terminate program
371 for pid in ${pidlist}; do
372 kill "${signal}" "${pid}"
373 if [ "${?}" -ne "0" ]; then return 1; fi
374 done
375 fi
376}
377
378################################################################################
379# pidofproc() #
380# Usage: pidofproc [-p pidfile] pathname #
381# #
382# Purpose: This function returns one or more pid(s) for a particular daemon #
383# #
384# Inputs: -p pidfile, use the specified pidfile instead of pidof #
385# pathname, path to the specified program #
386# #
387# Return values (as defined by LSB status codes): #
388# 0 - Success (PIDs to stdout) #
389# 1 - Program is dead, PID file still exists (remaining PIDs output) #
390# 3 - Program is not running (no output) #
391################################################################################
392pidofproc()
393{
394 local pidfile
395 local program
396 local prefix
397 local progname
398 local pidlist
399 local lpids
400 local exitstatus="0"
401
402 # Process arguments
403 while true; do
404 case "${1}" in
405
406 -p)
407 pidfile="${2}"
408 shift 2
409 ;;
410
411 *)
412 program="${1}"
413 if [ -n "${2}" ]; then
414 # Too many arguments
415 # Since this is status, return unknown
416 return 4
417 else
418 break
419 fi
420 ;;
421 esac
422 done
423
424 # If a PID file is not specified, try and find one.
425 if [ -z "${pidfile}" ]; then
426 # Get the program's basename
427 prefix=`echo "${program}" | sed 's/[^/]*$//'`
428
429 if [ -z "${prefix}" ]; then
430 progname="${program}"
431 else
432 progname=`echo "${program}" | sed "s@${prefix}@@"`
433 fi
434
435 # If a PID file exists with that name, assume that is it.
436 if [ -e "/var/run/${progname}.pid" ]; then
437 pidfile="/var/run/${progname}.pid"
438 fi
439 fi
440
441 # If a PID file is set and exists, use it.
442 if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
443
444 # Use the value in the first line of the pidfile
445 pidlist=`/bin/head -n1 "${pidfile}"`
446 # This can optionally be written as 'sed 1q' to repalce 'head -n1'
447 # should LFS move /bin/head to /usr/bin/head
448 else
449 # Use pidof
450 pidlist=`pidof "${program}"`
451 fi
452
453 # Figure out if all listed PIDs are running.
454 for pid in ${pidlist}; do
455 kill -0 ${pid} 2> /dev/null
456
457 if [ "${?}" -eq "0" ]; then
458 lpids="${lpids}${pid} "
459 else
460 exitstatus="1"
461 fi
462 done
463
464 if [ -z "${lpids}" -a ! -f "${pidfile}" ]; then
465 return 3
466 else
467 echo "${lpids}"
468 return "${exitstatus}"
469 fi
470}
471
472################################################################################
473# statusproc() #
474# Usage: statusproc [-p pidfile] pathname #
475# #
476# Purpose: This function prints the status of a particular daemon to stdout #
477# #
478# Inputs: -p pidfile, use the specified pidfile instead of pidof #
479# pathname, path to the specified program #
480# #
481# Return values: #
482# 0 - Status printed #
483# 1 - Input error. The daemon to check was not specified. #
484################################################################################
485statusproc()
486{
487 local pidfile
488 local pidlist
489
490 if [ "${#}" = "0" ]; then
491 echo "Usage: statusproc [-p pidfle] {program}"
492 exit 1
493 fi
494
495 # Process arguments
496 while true; do
497 case "${1}" in
498
499 -p)
500 pidfile="${2}"
501 shift 2
502 ;;
503
504 *)
505 if [ -n "${2}" ]; then
506 echo "Too many arguments"
507 return 1
508 else
509 break
510 fi
511 ;;
512 esac
513 done
514
515 if [ -n "${pidfile}" ]; then
516 pidlist=`pidofproc -p "${pidfile}" $@`
517 else
518 pidlist=`pidofproc $@`
519 fi
520
521 # Trim trailing blanks
522 pidlist=`echo "${pidlist}" | sed -r 's/ +$//'`
523
524 base="${1##*/}"
525
526 if [ -n "${pidlist}" ]; then
527 /bin/echo -e "${INFO}${base} is running with Process" \
528 "ID(s) ${pidlist}.${NORMAL}"
529 else
530 if [ -n "${base}" -a -e "/var/run/${base}.pid" ]; then
531 /bin/echo -e "${WARNING}${1} is not running but" \
532 "/var/run/${base}.pid exists.${NORMAL}"
533 else
534 if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
535 /bin/echo -e "${WARNING}${1} is not running" \
536 "but ${pidfile} exists.${NORMAL}"
537 else
538 /bin/echo -e "${INFO}${1} is not running.${NORMAL}"
539 fi
540 fi
541 fi
542}
543
544################################################################################
545# timespec() #
546# #
547# Purpose: An internal utility function to format a timestamp #
548# a boot log file. Sets the STAMP variable. #
549# #
550# Return value: Not used #
551################################################################################
552timespec()
553{
554 STAMP="$(echo `date +"%b %d %T %:z"` `hostname`) "
555 return 0
556}
557
558################################################################################
559# log_success_msg() #
560# Usage: log_success_msg ["message"] #
561# #
562# Purpose: Print a successful status message to the screen and #
563# a boot log file. #
564# #
565# Inputs: $@ - Message #
566# #
567# Return values: Not used #
568################################################################################
569log_success_msg()
570{
571 /bin/echo -n -e "${BMPREFIX}${@}"
572 /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}"
573
574 # Strip non-printable characters from log file
575 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
576
577 timespec
578 /bin/echo -e "${STAMP} ${logmessage} OK" >> ${BOOTLOG}
579
580 return 0
581}
582
583log_success_msg2()
584{
585 /bin/echo -n -e "${BMPREFIX}${@}"
586 /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}"
587
588 echo " OK" >> ${BOOTLOG}
589
590 return 0
591}
592
593################################################################################
594# log_failure_msg() #
595# Usage: log_failure_msg ["message"] #
596# #
597# Purpose: Print a failure status message to the screen and #
598# a boot log file. #
599# #
600# Inputs: $@ - Message #
601# #
602# Return values: Not used #
603################################################################################
604log_failure_msg()
605{
606 /bin/echo -n -e "${BMPREFIX}${@}"
607 /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}"
608
609 # Strip non-printable characters from log file
610
611 timespec
612 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
613 /bin/echo -e "${STAMP} ${logmessage} FAIL" >> ${BOOTLOG}
614
615 return 0
616}
617
618log_failure_msg2()
619{
620 /bin/echo -n -e "${BMPREFIX}${@}"
621 /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}"
622
623 echo "FAIL" >> ${BOOTLOG}
624
625 return 0
626}
627
628################################################################################
629# log_warning_msg() #
630# Usage: log_warning_msg ["message"] #
631# #
632# Purpose: Print a warning status message to the screen and #
633# a boot log file. #
634# #
635# Return values: Not used #
636################################################################################
637log_warning_msg()
638{
639 /bin/echo -n -e "${BMPREFIX}${@}"
640 /bin/echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${WARNING_SUFFIX}"
641
642 # Strip non-printable characters from log file
643 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
644 timespec
645 /bin/echo -e "${STAMP} ${logmessage} WARN" >> ${BOOTLOG}
646
647 return 0
648}
649
650log_skip_msg()
651{
652 /bin/echo -n -e "${BMPREFIX}${@}"
653 /bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}"
654
655 # Strip non-printable characters from log file
656 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
657 /bin/echo "SKIP" >> ${BOOTLOG}
658
659 return 0
660}
661
662################################################################################
663# log_info_msg() #
664# Usage: log_info_msg message #
665# #
666# Purpose: Print an information message to the screen and #
667# a boot log file. Does not print a trailing newline character. #
668# #
669# Return values: Not used #
670################################################################################
671log_info_msg()
672{
673 /bin/echo -n -e "${BMPREFIX}${@}"
674
675 # Strip non-printable characters from log file
676 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
677 timespec
678 /bin/echo -n -e "${STAMP} ${logmessage}" >> ${BOOTLOG}
679
680 return 0
681}
682
683log_info_msg2()
684{
685 /bin/echo -n -e "${@}"
686
687 # Strip non-printable characters from log file
688 logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
689 /bin/echo -n -e "${logmessage}" >> ${BOOTLOG}
690
691 return 0
692}
693
694################################################################################
695# evaluate_retval() #
696# Usage: Evaluate a return value and print success or failyure as appropriate #
697# #
698# Purpose: Convenience function to terminate an info message #
699# #
700# Return values: Not used #
701################################################################################
702evaluate_retval()
703{
704 local error_value="${?}"
705
706 if [ ${error_value} = 0 ]; then
707 log_success_msg2
708 else
709 log_failure_msg2
710 fi
711}
712
713################################################################################
714# check_signal() #
715# Usage: check_signal [ -{signal} | {signal} ] #
716# #
717# Purpose: Check for a valid signal. This is not defined by any LSB draft, #
718# however, it is required to check the signals to determine if the #
719# signals chosen are invalid arguments to the other functions. #
720# #
721# Inputs: Accepts a single string value in the form or -{signal} or {signal} #
722# #
723# Return values: #
724# 0 - Success (signal is valid #
725# 1 - Signal is not valid #
726################################################################################
727check_signal()
728{
729 local valsig
730
731 # Add error handling for invalid signals
732 valsig="-ALRM -HUP -INT -KILL -PIPE -POLL -PROF -TERM -USR1 -USR2"
733 valsig="${valsig} -VTALRM -STKFLT -PWR -WINCH -CHLD -URG -TSTP -TTIN"
734 valsig="${valsig} -TTOU -STOP -CONT -ABRT -FPE -ILL -QUIT -SEGV -TRAP"
735 valsig="${valsig} -SYS -EMT -BUS -XCPU -XFSZ -0 -1 -2 -3 -4 -5 -6 -8 -9"
736 valsig="${valsig} -11 -13 -14 -15"
737
738 echo "${valsig}" | grep -- " ${1} " > /dev/null
739
740 if [ "${?}" -eq "0" ]; then
741 return 0
742 else
743 return 1
744 fi
745}
746
747################################################################################
748# check_sig_type() #
749# Usage: check_signal [ -{signal} | {signal} ] #
750# #
751# Purpose: Check if signal is a program termination signal or a control signal #
752# This is not defined by any LSB draft, however, it is required to #
753# check the signals to determine if they are intended to end a #
754# program or simply to control it. #
755# #
756# Inputs: Accepts a single string value in the form or -{signal} or {signal} #
757# #
758# Return values: #
759# 0 - Signal is used for program termination #
760# 1 - Signal is used for program control #
761################################################################################
762check_sig_type()
763{
764 local valsig
765
766 # The list of termination signals (limited to generally used items)
767 valsig="-ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15"
768
769 echo "${valsig}" | grep -- " ${1} " > /dev/null
770
771 if [ "${?}" -eq "0" ]; then
772 return 0
773 else
774 return 1
775 fi
776}
777
778################################################################################
779# wait_for_user() #
780# #
781# Purpose: Wait for the user to respond if not a headless system #
782# #
783################################################################################
784wait_for_user()
785{
786 # Wait for the user by default
787 [ "${HEADLESS=0}" = "0" ] && read ENTER
788 return 0
789}
790
791################################################################################
792# is_true() #
793# #
794# Purpose: Utility to test if a variable is true | yes | 1 #
795# #
796################################################################################
797is_true()
798{
799 [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || [ "$1" = "y" ] ||
800 [ "$1" = "t" ]
801}
802
803# End /lib/lsb/init-functions
Note: See TracBrowser for help on using the repository browser.