Added support for generic Linux

This commit is contained in:
toloveru
2017-04-08 17:58:34 +02:00
parent 86846e29ed
commit d61238cd0b
3 changed files with 52 additions and 18 deletions

34
install
View File

@@ -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