github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/images/scripts/debian/update.sh (about)

     1  #!/bin/sh -eux
     2  
     3  arch="`uname -r | sed 's/^.*[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-[0-9]\{1,2\}\)-//'`"
     4  
     5  apt-get update;
     6  
     7  apt-get -y upgrade linux-image-$arch;
     8  apt-get -y install linux-headers-`uname -r`;
     9  
    10  if [ -d /etc/init ]; then
    11      # update package index on boot
    12      cat <<EOF >/etc/init/refresh-apt.conf;
    13  description "update package index"
    14  start on networking
    15  task
    16  exec /usr/bin/apt-get update
    17  EOF
    18  fi