This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support Fedora, redhat, CentOS by installing systemd service with
runas=$USER
- Loading branch information
Showing
4 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Check for FreeBSD in the uname output | ||
# If it's not FreeBSD, then we move on! | ||
if [ "$(uname -s)" == 'FreeBSD' ]; then | ||
OS='freebsd' | ||
# Check for a redhat-release file and see if we can | ||
# tell which Red Hat variant it is | ||
elif [ -f "/etc/redhat-release" ]; then | ||
RHV=$(egrep -o 'Fedora|CentOS|Red\ Hat|Red.Hat' /etc/redhat-release) | ||
case $RHV in | ||
Fedora) OS='fedora';; | ||
CentOS) OS='centos';; | ||
Red\ Hat) OS='redhat';; | ||
Red.Hat) OS='redhat';; | ||
esac | ||
# Check for debian_version | ||
elif [ -f "/etc/debian_version" ]; then | ||
OS='debian' | ||
# Check for arch-release | ||
elif [ -f "/etc/arch-release" ]; then | ||
OS='arch' | ||
# Check for SuSE-release | ||
elif [ -f "/etc/SuSE-release" ]; then | ||
OS='suse' | ||
fi | ||
# echo the result | ||
echo "$OS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
cat - <<EOF | ||
[Unit] | ||
Description=Kryptonite daemon | ||
[Service] | ||
ExecStart=/usr/bin/krd | ||
Restart=on-failure | ||
User=${SUDO_USER:-$USER} | ||
[Install] | ||
WantedBy=default.target | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters