mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-11 22:44:44 +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() {
|
webOutput() {
|
||||||
for var in "$@"; do
|
for var in "$@"; do
|
||||||
case "${var}" in
|
case "${var}" in
|
||||||
"-l" | "--latest" ) latest=true;;
|
"-l" | "--latest" ) echo "${WEBVERSIONLATEST:--1}";;
|
||||||
"-c" | "--current" ) current=true;;
|
"-c" | "--current" ) echo "${WEBVERSION}";;
|
||||||
|
"-h" | "--hash" ) echo "${WEBHASH}";;
|
||||||
* ) echo "::: Invalid Option!"; exit 1;
|
* ) echo "::: Invalid Option!"; exit 1;
|
||||||
esac
|
esac
|
||||||
done
|
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() {
|
coreOutput() {
|
||||||
for var in "$@"; do
|
for var in "$@"; do
|
||||||
case "${var}" in
|
case "${var}" in
|
||||||
"-l" | "--latest" ) latest=true;;
|
"-l" | "--latest" ) echo "${PHVERSIONLATEST:--1}";;
|
||||||
"-c" | "--current" ) current=true;;
|
"-c" | "--current" ) echo "${PHVERSION}";;
|
||||||
|
"-h" | "--hash" ) echo "${PHHASH}";;
|
||||||
* ) echo "::: Invalid Option!"; exit 1;
|
* ) echo "::: Invalid Option!"; exit 1;
|
||||||
esac
|
esac
|
||||||
done
|
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() {
|
helpFunc() {
|
||||||
|
|
Loading…
Reference in a new issue