Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e856ee0e
Commit
e856ee0e
authored
Mar 30, 2021
by
Frederic Crozat
Committed by
Brad Davidson
Mar 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace which with command -v (#3125)
Remove dependency on which binary, use shell internal equivalent. Signed-off-by:
Frederic Crozat
<
fcrozat@suse.com
>
parent
cb73461a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
install.sh
install.sh
+4
-4
No files found.
install.sh
View file @
e856ee0e
...
@@ -316,7 +316,7 @@ setup_verify_arch() {
...
@@ -316,7 +316,7 @@ setup_verify_arch() {
# --- verify existence of network downloader executable ---
# --- verify existence of network downloader executable ---
verify_downloader
()
{
verify_downloader
()
{
# Return failure if it doesn't exist or is no executable
# Return failure if it doesn't exist or is no executable
[
-x
"
$(
which
$1
)
"
]
||
return
1
[
-x
"
$(
command
-v
$1
)
"
]
||
return
1
# Set verified executable as our downloader program and return success
# Set verified executable as our downloader program and return success
DOWNLOADER
=
$1
DOWNLOADER
=
$1
...
@@ -545,7 +545,7 @@ create_symlinks() {
...
@@ -545,7 +545,7 @@ create_symlinks() {
for
cmd
in
kubectl crictl ctr
;
do
for
cmd
in
kubectl crictl ctr
;
do
if
[
!
-e
${
BIN_DIR
}
/
${
cmd
}
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
force
]
;
then
if
[
!
-e
${
BIN_DIR
}
/
${
cmd
}
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
force
]
;
then
which_cmd
=
$(
which
${
cmd
}
2>/dev/null
||
true
)
which_cmd
=
$(
command
-v
${
cmd
}
2>/dev/null
||
true
)
if
[
-z
"
${
which_cmd
}
"
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
force
]
;
then
if
[
-z
"
${
which_cmd
}
"
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
force
]
;
then
info
"Creating
${
BIN_DIR
}
/
${
cmd
}
symlink to k3s"
info
"Creating
${
BIN_DIR
}
/
${
cmd
}
symlink to k3s"
$SUDO
ln
-sf
k3s
${
BIN_DIR
}
/
${
cmd
}
$SUDO
ln
-sf
k3s
${
BIN_DIR
}
/
${
cmd
}
...
@@ -647,12 +647,12 @@ set -x
...
@@ -647,12 +647,12 @@ set -x
${
KILLALL_K3S_SH
}
${
KILLALL_K3S_SH
}
if
which
systemctl; then
if
command -v
systemctl; then
systemctl disable
${
SYSTEM_NAME
}
systemctl disable
${
SYSTEM_NAME
}
systemctl reset-failed
${
SYSTEM_NAME
}
systemctl reset-failed
${
SYSTEM_NAME
}
systemctl daemon-reload
systemctl daemon-reload
fi
fi
if
which
rc-update; then
if
command -v
rc-update; then
rc-update delete
${
SYSTEM_NAME
}
default
rc-update delete
${
SYSTEM_NAME
}
default
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment