#!/bin/sh
#(c) copyright Barry Kauler, May 2013, bkhome.org
#License GPL3 (refer /usr/share/doc/legal).
#called from /usr/sbin/loginmanager, to change back to 'root'.
#may also be called standalone.
#130527 first version.

NOWUSER="`whoami`"
[ "$NOWUSER" != "root" ] && exec sudo -A ${0} ${@}

export TEXTDOMAIN=user2root
export OUTPUT_CHARSET=UTF-8

#change auto login back to root...
rootEXPR="s%^tty1.*%tty1::respawn:/sbin/mingetty --autologin root tty1%"
sed -i -e "$rootEXPR" /etc/inittab #110507 TaZOC bug fix.
#120409 if using minit instead of busybox init...
if [ -f /etc/minit/getty/1/params  ];then #see my minit pet pkg.
 EXPR2='s%^fido$%root%'
 sed -i -e "$EXPR2" /etc/minit/getty/1/params
fi
pupmessage -bg green -center -title "$(gettext 'Login Manager: OK')" "$(gettext 'Ok, you will be administrator at next boot')"

###END###
