Changeset b7804ae for bootscripts/lfs/lib
- Timestamp:
- 02/22/2015 09:50:39 PM (10 years ago)
- Branches:
- 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, 12.2, 12.2-rc1, 7.7, 7.8, 7.9, 8.0, 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/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 9ee0e52a
- Parents:
- eb8b1c5
- Location:
- bootscripts/lfs/lib/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/lib/services/init-functions
reb8b1c5 rb7804ae 24 24 export PATH="/bin:/usr/bin:/sbin:/usr/sbin" 25 25 26 ## Screen Dimensions27 # Find current screen size28 if [ -z "${COLUMNS}" ]; then29 COLUMNS=$(stty size)30 COLUMNS=${COLUMNS##* }31 fi32 33 # When using remote connections, such as a serial port, stty size returns 034 if [ "${COLUMNS}" = "0" ]; then35 COLUMNS=8036 fi37 38 ## Measurements for positioning result messages39 COL=$((${COLUMNS} - 8))40 WCOL=$((${COL} - 2))41 42 ## Set Cursor Position Commands, used via echo43 SET_COL="\\033[${COL}G" # at the $COL char44 SET_WCOL="\\033[${WCOL}G" # at the $WCOL char45 CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char46 CURS_ZERO="\\033[0G"47 48 26 ## Set color commands, used via echo 49 27 # Please consult `man console_codes for more information … … 67 45 FAILURE_PREFIX="${FAILURE}*****${NORMAL}" 68 46 WARNING_PREFIX="${WARNING} *** ${NORMAL}" 47 SKIP_PREFIX="${INFO} S ${NORMAL}" 69 48 70 49 SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}" 71 50 FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}" 72 51 WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}" 52 SKIP_SUFFIX="${BRACKET}[${INFO} SKIP ${BRACKET}]${NORMAL}" 73 53 74 54 BOOTLOG=/run/bootlog … … 77 57 # Set any user specified environment variables e.g. HEADLESS 78 58 [ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site 59 60 ## Screen Dimensions 61 # Find current screen size 62 if [ -z "${COLUMNS}" ]; then 63 COLUMNS=$(stty size) 64 COLUMNS=${COLUMNS##* } 65 fi 66 67 # When using remote connections, such as a serial port, stty size returns 0 68 if [ "${COLUMNS}" = "0" ]; then 69 COLUMNS=80 70 fi 71 72 ## Measurements for positioning result messages 73 COL=$((${COLUMNS} - 8)) 74 WCOL=$((${COL} - 2)) 75 76 ## Set Cursor Position Commands, used via echo 77 SET_COL="\\033[${COL}G" # at the $COL char 78 SET_WCOL="\\033[${WCOL}G" # at the $WCOL char 79 CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char 80 CURS_ZERO="\\033[0G" 79 81 80 82 ################################################################################ … … 646 648 } 647 649 650 log_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 648 662 ################################################################################ 649 663 # log_info_msg() # -
bootscripts/lfs/lib/services/ipv4-static
reb8b1c5 rb7804ae 49 49 if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" = "" ]; then 50 50 51 # Cosmetic output not needed for multiple services51 # Cosmetic output 52 52 if ! $(echo ${SERVICE} | grep -q " "); then 53 53 log_info_msg2 "\n" # Terminate the previous message
Note:
See TracChangeset
for help on using the changeset viewer.