Permalink
Browse files

toolbox: replace some older 'bashisms', we want to be POSIX compliant

  • Loading branch information...
PeterPawn committed Oct 31, 2018
1 parent 3eef68c commit 8dc525df1cbe850ecd55d65806904b5c4fbb3aa6
@@ -200,7 +200,7 @@ get_values()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
dbgopt="-d"
shift
@@ -194,7 +194,7 @@ get_values()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
dbgopt="-d"
shift
@@ -226,7 +226,7 @@ get_values()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
dbgopt="-d"
shift
@@ -195,7 +195,7 @@ get_values()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
dbgopt="-d"
shift
@@ -54,7 +54,7 @@ tmpdir="/tmp"
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
shift
else
@@ -65,7 +65,7 @@ fi
# check 'keep checksum' option #
# #
#######################################################################################################
if [ "$1" = "-k" -o "$1" = "--keep-chksum" ]; then
if [ "$1" = "-k" ] || [ "$1" = "--keep-chksum" ]; then
noremove=1
shift
else
@@ -146,7 +146,8 @@ if [ "$sig" = "43 336 123 304" ]; then
[ $debug -eq 1 ] && printf "A TI checksum signature was found on '%s', file will be truncated by 8 byte.\n" "$f" 1>&2
dd if="$name" bs=$(( fs - 8 )) count=1 2>/dev/null
else
cat "$name" 2>/dev/null # it's faster than 'dd' for the complete file
# it's faster than 'dd' for the complete file
cat "$name" 2>/dev/null
fi
#######################################################################################################
# #
@@ -45,7 +45,7 @@ mkdir /var/tmp
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
shift
exec 2<>$tmpdir/${0##*/}.log
@@ -116,7 +116,7 @@ find_free_user()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
shift
else
@@ -49,7 +49,7 @@ start_service()
#####################################################################################
stop_service()
{
local pid=$(cat $my_pidfile 2>/dev/null)
pid="$(cat $my_pidfile 2>/dev/null)"
if [ ${#pid} -gt 0 ]; then
if [ -d /proc/$pid ]; then
printf "Service '%s' (pid %s) will be stopped now ...\n" "$my_display" "$pid" >/dev/console
@@ -115,7 +115,7 @@ find_userid()
# check debug option #
# #
#######################################################################################################
if [ "$1" = "-d" -o "$1" = "--debug" ]; then
if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then
debug=1
shift
else

0 comments on commit 8dc525d

Please sign in to comment.