fix some exit codes
This commit is contained in:
@@ -73,7 +73,7 @@ function CheckUser {
|
|||||||
|
|
||||||
if [[ ! "$(id -u)" == "0" ]]; then
|
if [[ ! "$(id -u)" == "0" ]]; then
|
||||||
printfail "This script needs to be ran as root"
|
printfail "This script needs to be ran as root"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -809,7 +809,7 @@ function CheckOS {
|
|||||||
OSNAME="CentOS"
|
OSNAME="CentOS"
|
||||||
if [[ ! $OSVERSION =~ ^(7|8) ]]; then
|
if [[ ! $OSVERSION =~ ^(7|8) ]]; then
|
||||||
printfail "Only CentOS 7/8 supported"
|
printfail "Only CentOS 7/8 supported"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
cmdlog "which xe"
|
cmdlog "which xe"
|
||||||
if [[ $(which xe 2>>$LOGFILE) ]]; then
|
if [[ $(which xe 2>>$LOGFILE) ]]; then
|
||||||
@@ -821,14 +821,14 @@ function CheckOS {
|
|||||||
OSNAME=$(grep ^NAME /etc/os-release | cut -d'=' -f2 | sed 's/"//g' | awk '{print $1}')
|
OSNAME=$(grep ^NAME /etc/os-release | cut -d'=' -f2 | sed 's/"//g' | awk '{print $1}')
|
||||||
if [[ $OSNAME == "Debian" ]] && [[ ! $OSVERSION =~ ^(8|9|10)$ ]]; then
|
if [[ $OSNAME == "Debian" ]] && [[ ! $OSVERSION =~ ^(8|9|10)$ ]]; then
|
||||||
printfail "Only Debian 8/9/10 supported"
|
printfail "Only Debian 8/9/10 supported"
|
||||||
exit 0
|
exit 1
|
||||||
elif [[ $OSNAME == "Ubuntu" ]] && [[ ! $OSVERSION =~ ^(16|18|20)$ ]]; then
|
elif [[ $OSNAME == "Ubuntu" ]] && [[ ! $OSVERSION =~ ^(16|18|20)$ ]]; then
|
||||||
printfail "Only Ubuntu 16/18/20 supported"
|
printfail "Only Ubuntu 16/18/20 supported"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
printfail "Only CentOS 7 / Ubuntu 16/18 and Debian 8/9 supported"
|
printfail "Only CentOS 7 / Ubuntu 16/18 and Debian 8/9 supported"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -837,7 +837,7 @@ function CheckSystemd {
|
|||||||
|
|
||||||
if [[ -z $(which systemctl) ]]; then
|
if [[ -z $(which systemctl) ]]; then
|
||||||
printfail "This tool is designed to work with systemd enabled systems only"
|
printfail "This tool is designed to work with systemd enabled systems only"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,7 +846,7 @@ function CheckDocker {
|
|||||||
if [[ -z $(which docker) ]]; then
|
if [[ -z $(which docker) ]]; then
|
||||||
echo
|
echo
|
||||||
printfail "Docker needs to be installed for this to work"
|
printfail "Docker needs to be installed for this to work"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user