mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
install.sh: Use -eq instead of = for integer comparison
For integer comparison, it is recommended to use '-eq' instead of the broader comparison '='. From the manual: n1 -eq n2 True if the integers n1 and n2 are algebraically equal. s1 = s2 True if the strings s1 and s2 are identical. Change-Id: I3a92c3944a19e7a618438a9e3e304d9de5d9874f Signed-off-by: Joakim Roubert <joakimr@axis.com>
This commit is contained in:
parent
ffe0288b68
commit
7a01e0fae3
@ -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
|
||||
|
||||
@ -397,7 +397,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
|
||||
@ -453,7 +453,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}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user