Skip to content

Commit

Permalink
remove negative exit codes and other shellchecks in wedge_power.sh
Browse files Browse the repository at this point in the history
Summary: I was getting shellcheck errors when editing this file in another diff. Negative exit codes and return values are not supported in bash: https://unix.stackexchange.com/questions/418784/what-is-the-min-and-max-values-of-exit-codes-in-linux

Test Plan: This is the only usage of it in code and it doesn't rely on a negative exit code (which couldn't happen anyways): https://www.internalfb.com/code/search?q=WEDGE_POWER_RESET_CMD

Differential Revision: D47138227

Reviewed By: smithscott

fbshipit-source-id: deac069c20862c5edb1fa3fc405cebef3d8dcbef
  • Loading branch information
Scott8440 authored and facebook-github-bot committed Jun 29, 2023
1 parent cf3cbbe commit 3872cdc
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ do_on() {
;;
*)
usage
exit -1
exit 1
;;

esac
Expand Down Expand Up @@ -158,7 +158,7 @@ do_reset() {
;;
*)
usage
exit -1
exit 1
;;
esac
done
Expand All @@ -184,7 +184,7 @@ do_reset() {
if ! wedge_is_us_on; then
echo "Power resetting microserver that is powered off has no effect."
echo "Use '$prog on' to power the microserver on"
return -1
return 1
fi
# reset TH first
reset_brcm.sh
Expand All @@ -202,27 +202,27 @@ do_reset() {

if [ $# -lt 1 ]; then
usage
exit -1
exit 1
fi

command="$1"
shift

case "$command" in
status)
do_status $@
do_status "$@"
;;
on)
do_on $@
do_on "$@"
;;
off)
do_off $@
do_off "$@"
;;
reset)
do_reset $@
do_reset "$@"
;;
*)
usage
exit -1
exit 1
;;
esac

0 comments on commit 3872cdc

Please sign in to comment.