Merge pull request #754 from joakimr-axis/joakimr-axis_comparison

install.sh: Use -eq instead of = for integer comparison
This commit is contained in:
Erik Wilson 2019-08-26 09:39:23 -07:00 committed by GitHub
commit b20f23ceb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ setup_env() {
# --- use sudo if we are not already root ---
SUDO=sudo
if [ $(id -u) = 0 ]; then
if [ $(id -u) -eq 0 ]; then
SUDO=
fi
@ -401,7 +401,7 @@ create_killall() {
$SUDO tee ${BIN_DIR}/${KILLALL_K3S_SH} >/dev/null << \EOF
#!/bin/sh
set -x
[ $(id -u) = 0 ] || exec sudo $0 $@
[ $(id -u) -eq 0 ] || exec sudo $0 $@
for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$bin:$PATH
@ -457,7 +457,7 @@ create_uninstall() {
$SUDO tee ${BIN_DIR}/${UNINSTALL_K3S_SH} >/dev/null << EOF
#!/bin/sh
set -x
[ \$(id -u) = 0 ] || exec sudo \$0 \$@
[ \$(id -u) -eq 0 ] || exec sudo \$0 \$@
${BIN_DIR}/${KILLALL_K3S_SH}