diff --git a/rootx b/rootx index e1febf3..d2d056c 100755 --- a/rootx +++ b/rootx @@ -1,21 +1,39 @@ -#!/bin/sh +#!/bin/echo "This Script Must Be Sourced!!!!" # rootx - Configure X For root User After An su or sudo Promotion # Copyright (c) 2012 TundraWare Inc., Des Plaines, IL USA # All Rights Reserved -# $Id: rootx,v 1.104 2012/12/27 23:15:08 toor Exp $ +# $Id: rootx,v 1.105 2013/02/12 18:37:11 toor Exp $ # Allow the DISPLAY variable to be overriden on the command line -if [ _$1 = _ ] -then - DISPLAY=localhost:10.0 +DISPLAY=localhost:10.0 -else - DISPLAY=$1 + +xrootBADARGS=FALSE +case $# +in + + 1) + ;; + + 2) + DISPLAY=$2 + ;; + + *) + echo "usage: . rootx user [display]" + xrootBADARGS=TRUE + ;; + +esac + + +if [ $xrootBADARGS != TRUE ] +then + + cp -pv /home/$1/.Xauthority /root/ + export DISPLAY fi -echo "Make sure you sourced me!" -cp -p /home/tundra/.Xauthority /root/ -export DISPLAY