-
-
Save zz/c1f38b03ab3dd1a75f23 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# | |
# Automatic update for made-in-ovh OVH kernels. | |
# | |
# VERSION :0.2 | |
# DATE :2015-02-10 | |
# AUTHOR :Viktor Szépe <[email protected]> | |
# LICENSE :The MIT License (MIT) | |
# URL :https://github.com/szepeviktor/debian-server-tools | |
# BASH-VERSION :4.2+ | |
# DOCUMENTATION :http://help.ovh.co.uk/KernelInstall | |
# RSS-FEED :http://www.ftp2rss.com/rss?v=1&ftp=ftp%3A%2F%2Fftp.ovh.net%2Fmade-in-ovh%2FbzImage&port=21&files=20 | |
# DEPENDS :apt-get install lftp heirloom-mailx | |
OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/" | |
# grsecurity + IPv6 + amd64 VPS | |
CURRENT="$(ls /boot/*-xxxx-grs-ipv6-64-vps)" | |
lftp -e "lcd /boot/; mirror -i '.*-xxxx-grs-ipv6-64-vps$'; bye" "$OVH_KERNELS" | |
NEW="$(ls /boot/*-xxxx-grs-ipv6-64-vps)" | |
if ! [ "$CURRENT" == "$NEW" ]; then | |
echo -e "update-grub && reboot\nnewest two:\n$(ls -1tr /boot/bzImage-*|tail -n2)" \ | |
| mailx -s "[$(hostname -s)] new kernel from OVH" root | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment