mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-01 22:43:38 +02:00
Fixes some exit error codes, according to "standards" :
* 0 : successful termination * 2 : command line syntax error * 1 : other kind of error
This commit is contained in:
parent
71705c402e
commit
4d34d2e755
1 changed files with 5 additions and 5 deletions
10
updater.sh
10
updater.sh
|
@ -48,7 +48,7 @@ elif [[ $(command -v 'wget') ]]; then
|
||||||
DOWNLOAD_METHOD='wget'
|
DOWNLOAD_METHOD='wget'
|
||||||
else
|
else
|
||||||
echo -e "${RED}This script requires curl or wget.\nProcess aborted${NC}"
|
echo -e "${RED}This script requires curl or wget.\nProcess aborted${NC}"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ usage() {
|
||||||
echo -e "\t-donotupdate,\t Use instead -d"
|
echo -e "\t-donotupdate,\t Use instead -d"
|
||||||
echo -e "\t-update,\t Use instead -u"
|
echo -e "\t-update,\t Use instead -u"
|
||||||
echo -e
|
echo -e
|
||||||
exit 1
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
legacy_argument () {
|
legacy_argument () {
|
||||||
|
@ -238,7 +238,7 @@ update_updater () {
|
||||||
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
||||||
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
||||||
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
||||||
exit 1
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ if [ $# != 0 ]; then
|
||||||
mv $tfile "${tfile}.js"
|
mv $tfile "${tfile}.js"
|
||||||
echo -e "${ORANGE}Warning: user.js was saved to temporary file ${tfile}.js${NC}"
|
echo -e "${ORANGE}Warning: user.js was saved to temporary file ${tfile}.js${NC}"
|
||||||
open_file "${tfile}.js"
|
open_file "${tfile}.js"
|
||||||
exit 1
|
exit 0
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
|
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
|
||||||
|
@ -424,7 +424,7 @@ if [ $# != 0 ]; then
|
||||||
;;
|
;;
|
||||||
:)
|
:)
|
||||||
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
|
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
|
||||||
exit 1
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue