2 # Filename: grml-screen
3 # Purpose: wrapper for screen to start with appropriate configuration
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 ################################################################################
9 # export variable USER for use withing GNU screen:
15 sudo chown $USER.tty $TTY
17 # try to mitigate raceconditions from screen
18 SCREENDIR_="/var/run/screen"
19 if [ `id -u` = 0 ] ; then
20 mkdir -m 755 $SCREENDIR_
21 chgrp utmp $SCREENDIR_
23 mkdir -m 700 "${SCREENDIR_}/S-$USER" &>/dev/null
25 # now run screen with config
26 cd $HOME # important for e.g. hardcopy-feature
28 if [ `id -u` = 0 ] ; then
29 exec screen -U -c /etc/grml/screenrc
30 elif [ -r "$HOME/.screenrc" ] ; then
31 exec screen -U -c "$HOME/.screenrc"
33 exec screen -U -c /etc/grml/screenrc_grml
36 ## END OF FILE #################################################################