Depend on console-tools; drop runit
[grml-scripts.git] / usr_bin / grml-init-screen
1 #!/bin/dash
2 # Filename:      grml-init-screen
3 # Purpose:       fix tty permissions and run screen and zsh afterwards
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Mit Mär 21 15:39:07 CET 2007 [mika]
8 ################################################################################
9
10 # export variable USER for use withing GNU screen:
11   export USER=`id -un`
12
13 # fix rungetty:
14   TTY=`tty`
15   sudo chmod 660       $TTY
16   sudo chown $USER.tty $TTY
17
18 # now start screen:
19   cd $HOME
20   # do we have a utf8 enabled terminal?
21   [ -x /usr/bin/vt-is-UTF8 ] && /usr/bin/vt-is-UTF8 -q && UTF='-U'
22   /usr/bin/screen $UTF -c /etc/grml/screenrc ; exec /bin/zsh
23
24 ## END OF FILE #################################################################