1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

Optimize code, undoc flag for current hash.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2017-03-03 20:32:26 -08:00
parent 9bb4a5fb25
commit 0341bd1758
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -50,37 +50,23 @@ normalOutput() {
webOutput() {
for var in "$@"; do
case "${var}" in
"-l" | "--latest" ) latest=true;;
"-c" | "--current" ) current=true;;
"-l" | "--latest" ) echo "${WEBVERSIONLATEST:--1}";;
"-c" | "--current" ) echo "${WEBVERSION}";;
"-h" | "--hash" ) echo "${WEBHASH}";;
* ) echo "::: Invalid Option!"; exit 1;
esac
done
if [[ "${latest}" == true && "${current}" == false ]]; then
echo "${WEBVERSIONLATEST:--1}"
elif [[ "${latest}" == false && "${current}" == true ]]; then
echo "${WEBVERSION}"
else
echo "::: Web-Admin version is ${WEBVERSION} (Latest version is ${WEBVERSIONLATEST:-${DEFAULT}})"
fi
}
coreOutput() {
for var in "$@"; do
case "${var}" in
"-l" | "--latest" ) latest=true;;
"-c" | "--current" ) current=true;;
"-l" | "--latest" ) echo "${PHVERSIONLATEST:--1}";;
"-c" | "--current" ) echo "${PHVERSION}";;
"-h" | "--hash" ) echo "${PHHASH}";;
* ) echo "::: Invalid Option!"; exit 1;
esac
done
if [[ "${latest}" == true && "${current}" == false ]]; then
echo "${PHVERSIONLATEST:--1}"
elif [[ "${latest}" == false && "${current}" == true ]]; then
echo "${PHVERSION}"
else
echo "::: Pi-hole version is ${PHVERSION} (Latest version is ${PHVERSIONLATEST:-${DEFAULT}})"
fi
}
helpFunc() {