Skip to content

Commit 3d18aa9

Browse files
committed
Update the installation script to deal with SELinux
1 parent 7f40bb2 commit 3d18aa9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@
7373
# Remove the temporary directory.
7474
rm -rf "$TEMPDIR"
7575

76+
# If SELinux is installed, apply the default security context to the binary.
77+
# shellcheck disable=SC2024
78+
if command -v restorecon 2> /dev/null; then
79+
restorecon "$DESTINATION" 2> /dev/null ||
80+
sudo restorecon "$DESTINATION" < /dev/tty ||
81+
fail 'Failed to set SELinux attributes on the binary.'
82+
fi
83+
7684
# Let the user know if the installation was successful.
7785
"$DESTINATION" --version || fail 'There was an error installing the binary.'
7886
)

0 commit comments

Comments
 (0)