Skip to content

Instantly share code, notes, and snippets.

@thibault-ketterer
Last active January 8, 2018 10:15
Show Gist options
  • Save thibault-ketterer/0bb0f30d853280987055e7ca6b01e7fc to your computer and use it in GitHub Desktop.
Save thibault-ketterer/0bb0f30d853280987055e7ca6b01e7fc to your computer and use it in GitHub Desktop.

Revisions

  1. thibault-ketterer revised this gist Jan 8, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update_kernel_ovh.sh
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ apt-get install -y lftp bsd-mailx
    # OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"
    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/4.14.12/"

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

    lftp -e "lcd /boot/; mirror -i '.*-xxxx-std-ipv6-64$'; bye" "$OVH_KERNELS"

  2. thibault-ketterer revised this gist Jan 8, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion update_kernel_ovh.sh
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,8 @@
    set -e
    apt-get install -y lftp bsd-mailx

    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"
    # OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"
    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/4.14.12/"

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

  3. thibault-ketterer revised this gist Jan 5, 2018. 1 changed file with 23 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions update_kernel_ovh.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,28 @@
    #!/bin/bash

    # MIT License
    #
    # Copyright (c) 2017 thibault ketterer
    #
    # Permission is hereby granted, free of charge, to any person obtaining a copy
    # of this software and associated documentation files (the "Software"), to deal
    # in the Software without restriction, including without limitation the rights
    # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    # copies of the Software, and to permit persons to whom the Software is
    # furnished to do so, subject to the following conditions:
    #
    # The above copyright notice and this permission notice shall be included in all
    # copies or substantial portions of the Software.
    #
    # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    # SOFTWARE.


    set -e
    apt-get install -y lftp bsd-mailx

  4. thibault-ketterer created this gist Jan 5, 2018.
    19 changes: 19 additions & 0 deletions update_kernel_ovh.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash

    set -e
    apt-get install -y lftp bsd-mailx

    OVH_KERNELS="ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production/"

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

    lftp -e "lcd /boot/; mirror -i '.*-xxxx-std-ipv6-64$'; bye" "$OVH_KERNELS"

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

    if ! [ "$CURRENT" == "$NEW" ]; then
    echo "upgrading kernel on $HOSTNAME" | mail -s "[$(hostname -s)] new kernel from OVH" root
    # uncomment me
    #update-grub && reboot

    fi