Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Last active October 30, 2024 19:21

Revisions

  1. szepeviktor revised this gist Feb 10, 2015. 1 changed file with 5 additions and 8 deletions.
    13 changes: 5 additions & 8 deletions ovh-kernel-update.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@
    #
    # Automatic update for made-in-ovh OVH kernels.
    #
    # VERSION :0.1
    # DATE :2014-12-03
    # 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
    @@ -12,17 +12,14 @@
    # 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

    # grsecurity + IPv6 + amd64 VPS
    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"

    # grsecurity + IPv6 + amd64 VPS
    CURRENT="$(ls /boot/*-xxxx-grs-ipv6-64-vps)"

    cd /boot/
    lftp -e "mirror -i '.*-xxxx-grs-ipv6-64-vps$'; bye" "$OVH_KERNELS"

    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 "Reboot neccessary.\nnewest two: $(ls -1tr /boot/bzImage-* | tail -n 2)" \
    echo -e "update-grub && reboot\nnewest two:\n$(ls -1tr /boot/bzImage-*|tail -n2)" \
    | mailx -s "[$(hostname -s)] new kernel from OVH" root
    fi
  2. szepeviktor revised this gist Dec 3, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ovh-kernel-update.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    # 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

    # grsecurity + IPv6 + amd64 VPS
    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"
  3. szepeviktor revised this gist Dec 3, 2014. No changes.
  4. szepeviktor created this gist Dec 3, 2014.
    27 changes: 27 additions & 0 deletions ovh-kernel-update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/bin/bash
    #
    # Automatic update for made-in-ovh OVH kernels.
    #
    # VERSION :0.1
    # DATE :2014-12-03
    # 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

    # grsecurity + IPv6 + amd64 VPS
    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"

    CURRENT="$(ls /boot/*-xxxx-grs-ipv6-64-vps)"

    cd /boot/
    lftp -e "mirror -i '.*-xxxx-grs-ipv6-64-vps$'; bye" "$OVH_KERNELS"

    NEW="$(ls /boot/*-xxxx-grs-ipv6-64-vps)"

    if ! [ "$CURRENT" == "$NEW" ]; then
    echo -e "Reboot neccessary.\nnewest two: $(ls -1tr /boot/bzImage-* | tail -n 2)" \
    | mailx -s "[$(hostname -s)] new kernel from OVH" root
    fi