-# char *add_suffix(char * configfile)
-#
-# Returns a config file name with the softlevel suffix
-# appended to it. For use with multi-config services.
-add_suffix() {
- if [ "${RC_USE_CONFIG_PROFILE}" = "yes" -a -e "$1.${DEFAULTLEVEL}" ]
- then
- printf "$1.${DEFAULTLEVEL}\n"
- else
- printf "$1\n"
- fi
-
- return 0
-}
-
-# Setup a basic $PATH. Just add system default to existing.
-# This should solve both /sbin and /usr/sbin not present when
-# doing 'su -c foo', or for something like: PATH= rcscript start
-PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:${PATH}"
-
-if [ "$(/sbin/consoletype 2> /dev/null)" = "serial" ] ; then
- # We do not want colors/endcols on serial terminals
- RC_NOCOLOR="yes"
- RC_ENDCOL="no"
-fi
-
-for arg in "$@" ; do
- case "${arg}" in
- # Lastly check if the user disabled it with --nocolor argument
- --nocolor|-nc)
- RC_NOCOLOR="yes"
- ;;
- esac
-done
-
-# Setup COLS and ENDCOL so eend can line up the [ ok ]
-# width of [ ok ] == 7
-COLS="$(stty size 2>/dev/null | cut -d' ' -f2)"
-if [ -z "${COLS}" ] || [ "${COLS}" -le 0 ] ; then
- COLS=80
-fi
-
-if [ "${RC_ENDCOL}" = "yes" ]; then
- ENDCOL="\e[A\e[$(( ${COLS} - 8 ))G"
-else
- ENDCOL=''
-fi
-
-# Setup the colors so our messages all look pretty
-if [ "${RC_NOCOLOR}" = "yes" ]; then
- unset GOOD WARN BAD NORMAL HILITE BRACKET
-else
- GOOD='\e[32;01m'
- WARN='\e[33;01m'
- BAD='\e[31;01m'
- NORMAL='\e[0m'
- HILITE='\e[36;01m'
- BRACKET='\e[34;01m'
-fi
-
-# vim:ts=4