X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2Fvariables.bashrc;fp=.profile.d%2Fvariables.bashrc;h=616be4e69d0ec13274b5ee76d2d13eb323e43ecc;hp=8fa34ab00ddde97d8dcfce4b0523be120e4aab2e;hb=506b1084a423c7b3462495db47bc5762133197e5;hpb=d971afe79263574329b54a4e63ab1d996d24ce9f diff --git a/.profile.d/variables.bashrc b/.profile.d/variables.bashrc index 8fa34ab..616be4e 100644 --- a/.profile.d/variables.bashrc +++ b/.profile.d/variables.bashrc @@ -25,5 +25,13 @@ elif [ $colours -gt 88 ]; then else export GREP_COLORS='cx=31:sl=:mt=33:fn=36:ln=34:bn=33:se=31' fi -export SCREENDIR="$HOME/.screen/$HOSTNAME" + +# Override SCREENDIR iff screen is not setuid. +screen=$(which screen 2>/dev/null) +if [ ! -z "$screen" ]; then + if ! ls -l "$screen" | cut -d ' ' -f 1 | grep s >/dev/null; then + export SCREENDIR="$HOME/.screen/$HOSTNAME" + fi +fi +unset screen #mkdir -p "$SCREENDIR"