Changeset bd899fb for bootscripts/lfs/lib
- Timestamp:
- 01/27/2012 08:39:49 PM (13 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.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 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:
- bb75f17
- Parents:
- 661b744
- Location:
- bootscripts/lfs/lib/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/lib/services/init-functions
r661b744 rbd899fb 68 68 WARNING_PREFIX="${WARNING} *** ${NORMAL}" 69 69 70 SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}" 71 FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}" 72 WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}" 73 70 74 BOOTLOG=/run/var/bootlog 71 75 KILLDELAY=3 … … 568 572 { 569 573 echo -n -e "${BMPREFIX}${@}" 570 echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${ BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"574 echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" 571 575 572 576 # Strip non-printable characters from log file … … 582 586 { 583 587 echo -n -e "${BMPREFIX}${@}" 584 echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${ BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"588 echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" 585 589 586 590 echo " OK" >> ${BOOTLOG} … … 603 607 { 604 608 echo -n -e "${BMPREFIX}${@}" 605 echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${ BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"609 echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" 606 610 607 611 # Strip non-printable characters from log file … … 617 621 { 618 622 echo -n -e "${BMPREFIX}${@}" 619 echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${ BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"623 echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" 620 624 621 625 echo "FAIL" >> ${BOOTLOG} … … 636 640 { 637 641 echo -n -e "${BMPREFIX}${@}" 638 echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${ BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"642 echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${WARNING_SUFFIX}" 639 643 640 644 # Strip non-printable characters from log file -
bootscripts/lfs/lib/services/ipv4-static
r661b744 rbd899fb 43 43 case "${2}" in 44 44 up) 45 if [ "$(ip addr show ${1} | grep ${IP})" == "" ]; then 46 log_info_msg2 "\n" # Terminate the previous message 45 if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP})" == "" ]; then 46 47 # Cosmetic output not needed for multiple services 48 if ! $(echo ${SERVICE} | grep -q " "); then 49 log_info_msg2 "\n" # Terminate the previous message 50 fi 51 47 52 log_info_msg "Adding IPv4 address ${IP} to the ${1} interface..." 48 53 ip addr add ${args} dev ${1} … … 65 70 66 71 down) 67 if [ "$(ip addr show ${1} | grep ${IP})" != "" ]; then72 if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP})" != "" ]; then 68 73 log_info_msg "Removing IPv4 address ${IP} from the ${1} interface..." 69 74 ip addr del ${args} dev ${1} … … 73 78 if [ -n "${GATEWAY}" ]; then 74 79 # Only remove the gateway if ther are no remaining ipv4 addresses 75 if [ "$(ip addr show ${1} | grep 'inet ')" != "" ]; then80 if [ "$(ip addr show ${1} 2>/dev/null | grep 'inet ')" != "" ]; then 76 81 log_info_msg "Removing default gateway..." 77 82 ip route del default
Note:
See TracChangeset
for help on using the changeset viewer.