Added support for generic Linux
This commit is contained in:
34
install
34
install
@@ -35,7 +35,35 @@ function install_arch_manjaro(){
|
||||
fi
|
||||
printf "Installation complete.\n"
|
||||
}
|
||||
|
||||
function install_generic(){
|
||||
cp kernelcheck /usr/local/sbin/kernelcheck
|
||||
cp notify_all /usr/local/sbin/notify_all
|
||||
if ! hash crontab &>/dev/null
|
||||
then
|
||||
printf "This tool depends on cron to schedule kernel checks. Exiting..\n"
|
||||
exit 1
|
||||
fi
|
||||
if hash systemctl &>/dev/null
|
||||
then
|
||||
if [ $(systemctl is-active cronie) == inactive ]
|
||||
then
|
||||
printf "Enabling cronie command scheduler..\n"
|
||||
systemctl start cronie.service &>/dev/null
|
||||
systemctl enable cronie.service &>/dev/null
|
||||
fi
|
||||
else
|
||||
printf "You don't seem to be using systemd.. Please enable cronie manually.\n"
|
||||
fi
|
||||
if ! grep -Fxq "@hourly /usr/local/sbin/kernelcheck" /var/spool/cron/root 2>/dev/null
|
||||
then
|
||||
printf "Installing hourly service in crontab..\n"
|
||||
(crontab -l 2>/dev/null; echo "@hourly /usr/local/sbin/kernelcheck" ) | crontab -
|
||||
elif grep -Fxq "@hourly /usr/local/sbin/kernelcheck" /var/spool/cron/root
|
||||
then
|
||||
printf "Crontab entry found. Skipping..\n"
|
||||
fi
|
||||
printf "Installation complete.\n"
|
||||
}
|
||||
if [ -f /etc/manjaro-release ]
|
||||
then
|
||||
printf "Installing for Manjaro Linux...\n"
|
||||
@@ -44,4 +72,8 @@ elif [ -f /etc/arch-release ]
|
||||
then
|
||||
printf "Installing for Arch Linux...\n"
|
||||
install_arch_manjaro
|
||||
elif [ $(uname) == Linux ]
|
||||
then
|
||||
printf "Distribution not yet supported.\nInstalling for generic Linux..\n"
|
||||
install_generic
|
||||
fi
|
||||
|
Reference in New Issue
Block a user