Skip to content

Commit

Permalink
fix 2>/dev/null
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberAndi committed Dec 14, 2023
1 parent 53ef105 commit 6325448
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions openWRT_install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,46 +429,46 @@ if [ ! -z $2 ]
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" restart)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" restart 2>/dev/null)
wait $erg
fi;;
"start")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" start)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" start 2>/dev/null)
wait $erg
fi;;
"stop")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" stop)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" stop 2>/dev/null)
wait $erg
fi;;
"enable")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" enable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" enable 2>/dev/null)
wait $erg
fi;;
"disable")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" disable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" disable 2>/dev/null)
wait $erg
fi;;
"inactive")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" stop)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" stop 2>/dev/null)
wait $erg
erg=""
erg=$(/etc/init.d/"$1" disable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" disable 2>/dev/null)
wait $erg
fi;;
*)
echo "false state!"
Expand All @@ -480,39 +480,39 @@ if [ ! -z $2 ]
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" restart)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" restart 2>/dev/null)
wait $erg
fi;;
"start")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" start)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" start 2>/dev/null)
wait $erg
fi;;
"enable")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" enable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" enable 2>/dev/null)
wait $erg
fi;;
"disable")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" disable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" disable 2>/dev/null)
wait $erg
fi;;
"inactive")
if [ $2 != $(/etc/init.d/"$1" status) ]
then
erg=""
erg=$(/etc/init.d/"$1" stop)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" stop 2>/dev/null)
wait $erg
erg=""
erg=$(/etc/init.d/"$1" disable)
wait $erg 2>/dev/null
erg=$(/etc/init.d/"$1" disable 2>/dev/null)
wait $erg
fi;;
*)
echo "false state!"
Expand All @@ -530,7 +530,7 @@ if [ ! -z $2 ]
then
if [ -z $(echo $(/etc/init.d/"$1" status) | grep 'not found') ]
then
echo $(/etc/init.d/"$1" status) 2>/dev/null
echo $(/etc/init.d/"$1" status 2>/dev/null)

fi
fi
Expand Down

0 comments on commit 6325448

Please sign in to comment.