#!/bin/bash -ef
#
# Initiation of signing regime without package updating
#
SELCONF="/etc/selinux/config"
SETENFORCE="setenforce"

echo  "starting applying integrity" >/dev/tty1
touch /etc/noupdate
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
