#!/bin/bash
read -p "WARNING: The graphical server is about to be shut down!
Make sure you close all other apps before proceeding.
Press Enter to continue, or Ctrl+C to cancel."
CURUSER=$(id -un)
CURVT=$(sudo fgconsole)
if [ $CURVT -eq 7 ]
then
sudo chvt 1
fi
sudo screen -dm bash -c "service nodm stop ; su $CURUSER -c 'export LD_LIBRARY_PATH=/opt/libmali-gbm ; /usr/local/bin/kodi' ; service nodm start"
