user2root 843 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. #(c) copyright Barry Kauler, May 2013, bkhome.org
  3. #License GPL3 (refer /usr/share/doc/legal).
  4. #called from /usr/sbin/loginmanager, to change back to 'root'.
  5. #may also be called standalone.
  6. #130527 first version.
  7. NOWUSER="`whoami`"
  8. [ "$NOWUSER" != "root" ] && exec sudo -A ${0} ${@}
  9. export TEXTDOMAIN=user2root
  10. export OUTPUT_CHARSET=UTF-8
  11. #change auto login back to root...
  12. rootEXPR="s%^tty1.*%tty1::respawn:/sbin/mingetty --autologin root tty1%"
  13. sed -i -e "$rootEXPR" /etc/inittab #110507 TaZOC bug fix.
  14. #120409 if using minit instead of busybox init...
  15. if [ -f /etc/minit/getty/1/params ];then #see my minit pet pkg.
  16. EXPR2='s%^fido$%root%'
  17. sed -i -e "$EXPR2" /etc/minit/getty/1/params
  18. fi
  19. pupmessage -bg green -center -title "$(gettext 'Login Manager: OK')" "$(gettext 'Ok, you will be administrator at next boot')"
  20. ###END###