Release new version 2.13.0
[grml-scripts.git] / usr_share / run-screen
1 #!/bin/sh
2 # Filename:      run-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 ################################################################################
8
9 export SHELL=/bin/zsh
10 # try to mitigate raceconditions from screen
11 SCREENDIR_="/var/run/screen"
12 mkdir -m 700 "${SCREENDIR_}/S-$USER" >/dev/null 2>&1
13
14 # now run screen with config
15
16   if [ "$(id -u)" = 0 ] ; then
17     exec screen -U -c /etc/grml/screenrc -s "-$SHELL"
18   elif [ -r "$HOME/.screenrc" ] ; then
19     exec screen -U -c "$HOME/.screenrc" -s "-$SHELL"
20   else
21     exec screen -U -c /etc/grml/screenrc_generic -s "-$SHELL"
22   fi
23
24 ## END OF FILE #################################################################