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
51f8a1a0
Unverified
Commit
51f8a1a0
authored
Nov 23, 2019
by
Johan Kok
Committed by
GitHub
Nov 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify selinux status before downloading
parent
18bd921c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
install.sh
install.sh
+15
-9
No files found.
install.sh
View file @
51f8a1a0
...
...
@@ -271,6 +271,15 @@ verify_downloader() {
return
0
}
# --- verify existence of semanage when SELinux is enabled ---
verify_semanage
()
{
if
[
-x
"
$(
which getenforce
)
"
]
;
then
if
[
"Disabled"
!=
$(
getenforce
)
]
&&
[
!
-x
"
$(
which semanage
)
"
]
;
then
fatal
'SELinux is enabled but semanage is not found'
fi
fi
}
# --- create tempory directory and cleanup when done ---
setup_tmp
()
{
TMP_DIR
=
$(
mktemp
-d
-t
k3s-install.XXXXXXXXXX
)
...
...
@@ -374,15 +383,11 @@ setup_binary() {
if
command
-v
getenforce
>
/dev/null 2>&1
;
then
if
[
"Disabled"
!=
$(
getenforce
)
]
;
then
if
command
-v
semanage
>
/dev/null 2>&1
;
then
info
'SELinux is enabled, setting permissions'
if
!
$SUDO
semanage fcontext
-l
|
grep
"
${
BIN_DIR
}
/k3s"
>
/dev/null 2>&1
;
then
$SUDO
semanage fcontext
-a
-t
bin_t
"
${
BIN_DIR
}
/k3s"
fi
$SUDO
restorecon
-v
${
BIN_DIR
}
/k3s
>
/dev/null
else
fatal
'SELinux is enabled but semanage is not found'
fi
info
'SELinux is enabled, setting permissions'
if
!
$SUDO
semanage fcontext
-l
|
grep
"
${
BIN_DIR
}
/k3s"
>
/dev/null 2>&1
;
then
$SUDO
semanage fcontext
-a
-t
bin_t
"
${
BIN_DIR
}
/k3s"
fi
$SUDO
restorecon
-v
${
BIN_DIR
}
/k3s
>
/dev/null
fi
fi
}
...
...
@@ -397,6 +402,7 @@ download_and_verify() {
setup_verify_arch
verify_downloader curl
||
verify_downloader wget
||
fatal
'Can not find curl or wget for downloading files'
verify_semanage
setup_tmp
get_release_version
download_hash
...
...
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