#!/bin/bash -ef
#
# Initiation of apt-get update from the initial regime
#
SELCONF="/etc/selinux/config"
SETENFORCE="setenforce"
echo  "starting update" >/dev/tty1
apt-get update
if [ -f "$SELCONF" ] ;
then
 $SETENFORCE 0
fi
updater-utils fix fix sha1
update-grub ||:
if [ -f $SELCONF ] ;
then
  $SETENFORCE 1
fi
systemctl disable integalert.service
mkdir -p /var/lib/updater
systemctl get-default >/var/lib/updater/oldstate
if [ $(systemctl get-default) == "graphical.target" ] ;
then
   systemctl set-default multi-user.target
fi
systemctl enable updater-main
systemctl disable updater-after
systemctl disable updater-signing
echo  "Rebooting" >/dev/tty1
reboot -fp
