mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Optimize code, undoc flag for current hash.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
9bb4a5fb25
commit
0341bd1758
1 changed files with 6 additions and 20 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue