Author: dj
Date: 2010-06-27 01:33:25 -0600 (Sun, 27 Jun 2010)
New Revision: 9324
Modified:
trunk/BOOK/bootscripts/contrib/lsb-v3/ChangeLog
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/checkfs
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/lfs-functions
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/localnet
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/rc
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/sendsignals
trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/udev
trunk/BOOK/bootscripts/contrib/lsb-v3/lsb/init-functions
Log:
Standardized urinary comparisons^Cn tests
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/ChangeLog
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/ChangeLog 2010-06-27 07:05:07 UTC
(rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/ChangeLog 2010-06-27 07:33:25 UTC
(rev 9324)
@@ -1,6 +1,7 @@
ChangeLog
20100627 - [dj] * Sync to LFS-Bootscripts-20100627 (killall in new sysvinit).
+ * Standardized syntax for urinary comparisons in tests.
20100529 - [matthew]
* Only copy /lib/udev/devices/null, as Udev >= 155 copies
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/checkfs
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/checkfs 2010-06-27
07:05:07 UTC (rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/checkfs 2010-06-27
07:33:25 UTC (rev 9324)
@@ -25,7 +25,7 @@
fi
mount -n -o remount,ro / >/dev/null
- if [ ${?} != 0 ]
+ if [ ${?} -ne 0 ]
then
log_failure_msg "Mounting root file system in read-only mode"
echo -e "${FAILURE}FAILURE:\n"
@@ -53,17 +53,17 @@
fsck ${options} -a -A -C -T
error_value=${?}
- if [ "${error_value}" = 0 ]
+ if [ "${error_value}" -eq 0 ]
then
log_success_msg "Checking file systems..."
- elif [ "${error_value}" = 1 ]
+ elif [ "${error_value}" -eq 1 ]
then
log_warning_msg "Checking file systems..."
echo -e "${WARNING}WARNING:\n"
echo -e "${WARNING}File system errors were found and have been"
echo -e "${WARNING}corrected. You may want to double-check that"
echo -e "${WARNING}everything was fixed properly.${NORMAL}"
- elif [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then
+ elif [ "${error_value}" -eq 2 -o "${error_value}" -eq 3 ]; then
log_warning_msg "Checking file systems..."
echo -e "${WARNING}WARNING:\n"
echo -e "${WARNING}File system errors were found and have been
been"
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/lfs-functions
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/lfs-functions 2010-06-27
07:05:07 UTC (rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/lfs-functions 2010-06-27
07:33:25 UTC (rev 9324)
@@ -77,7 +77,7 @@
pidlist=`pidofproc "${BIN_FILE}"`
STATUS=$?
echo "Checking ${MESSAGE} status:"
- if [ "${STATUS}" = "0" ]; then
+ if [ "${STATUS}" -eq "0" ]; then
log_success_msg "Running with PID(s) ${pidlist}"
else
log_warning_msg "Not running!"
@@ -202,7 +202,7 @@
# Print messages for the generic force-reload, reload, restart,
# and try-restart targets
- if [ "${error_value}" = "0" ]
+ if [ "${error_value}" -eq "0" ]
then
log_success_msg "${message}${MESSAGE} "
return "${error_value}"
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/localnet
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/localnet 2010-06-27
07:05:07 UTC (rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/localnet 2010-06-27
07:33:25 UTC (rev 9324)
@@ -22,7 +22,7 @@
start)
ip addr add 127.0.0.1/8 label lo dev lo
ip link set lo up
- if [ "${?}" = "0" ]
+ if [ "${?}" -eq "0" ]
then
log_success_msg "Bringing up the loopback interface..."
else
@@ -30,7 +30,7 @@
fi
hostname "${HOSTNAME}"
- if [ "${?}" = "0" ]
+ if [ "${?}" -eq "0" ]
then
log_success_msg "Setting hostname to ${HOSTNAME}..."
else
@@ -41,7 +41,7 @@
stop)
ip link set lo down
- if [ "${?}" = "0" ]
+ if [ "${?}" -eq "0" ]
then
log_success_msg "Bringing down the loopback interface..."
else
@@ -60,7 +60,7 @@
retval=$(( "${retval}" + "${?}" ))
hostname "${HOSTNAME}"
retval=$(( "${retval}" + "${?}" ))
- if [ "${retval}" = "0" ]
+ if [ "${retval}" -eq "0" ]
then
log_success_msg "Restarting local network..."
else
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/rc
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/rc 2010-06-27 07:05:07 UTC
(rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/rc 2010-06-27 07:33:25 UTC
(rev 9324)
@@ -119,7 +119,7 @@
${link} stop
error_value=${?}
- if [ "${error_value}" != "0" ]; then
+ if [ "${error_value}" -ne "0" ]; then
print_error_msg
fi
done
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/sendsignals
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/sendsignals 2010-06-27
07:05:07 UTC (rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/sendsignals 2010-06-27
07:33:25 UTC (rev 9324)
@@ -22,8 +22,8 @@
killall5 -15
error_value=${?}
# Account for successful return value of 2
- if [ ${error_value} = 2 ]
- error_value="0"
+ if [ ${error_value} -eq 2 ]
+ error_value=0
fi
sleep 3
@@ -34,8 +34,8 @@
killall5 -9
error_value=${?}
# Account for successful return value of 2
- if [ ${error_value} = 2 ]
- error_value="0"
+ if [ ${error_value} -eq 2 ]
+ error_value=0
fi
sleep 3
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/udev
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/udev 2010-06-27 07:05:07 UTC
(rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/init.d/udev 2010-06-27 07:33:25 UTC
(rev 9324)
@@ -40,7 +40,7 @@
if ! mountpoint /dev > /dev/null; then
mount -n -t tmpfs tmpfs /dev -o mode=755
fi
- if [ ${?} != 0 ]; then
+ if [ ${?} -ne 0 ]; then
echo_failure
boot_mesg -n "FAILURE:\n\nCannot mount a tmpfs"
${FAILURE}
boot_mesg -n " onto /dev, this system will be halted."
Modified: trunk/BOOK/bootscripts/contrib/lsb-v3/lsb/init-functions
===================================================================
--- trunk/BOOK/bootscripts/contrib/lsb-v3/lsb/init-functions 2010-06-27
07:05:07 UTC (rev 9323)
+++ trunk/BOOK/bootscripts/contrib/lsb-v3/lsb/init-functions 2010-06-27
07:33:25 UTC (rev 9324)
@@ -201,7 +201,7 @@
# Check for a valid signal
check_signal "${signal}"
- if [ "${?}" != "0" ]
+ if [ "${?}" -ne "0" ]
then
return 2
fi
@@ -278,7 +278,7 @@
kill "${signal}" "${pid}" 2> /dev/null
# Wait up to ${delay}/10 seconds to for "${pid}" to
# terminate in 10ths of a second
- while [ "${delay}" != "0" ]
+ while [ "${delay}" -ne "0" ]
do
kill -0 "${pid}" 2> /dev/null || piddead="1"
if [ "${piddead}" = "1" ]
@@ -413,7 +413,7 @@
for pid in ${pidlist}
do
kill -0 ${pid} 2> /dev/null
- if [ "${?}" = "0" ]; then
+ if [ "${?}" -eq "0" ]; then
lpids="${pids}${pid} "
else
exitstatus="1"
@@ -534,7 +534,7 @@
valsig="${valsig} -11 -13 -14 -15"
echo "${valsig}" | grep -- " ${1} " > /dev/null
- if [ "${?}" = "0" ]
+ if [ "${?}" -eq "0" ]
then
return 0
else
@@ -566,7 +566,7 @@
valsig="-ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15"
echo "${valsig}" | grep -- " ${1} " > /dev/null
- if [ "${?}" = "0" ]
+ if [ "${?}" -eq "0" ]
then
return 0
else
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page