Rewrote to only run as a sourced script and to require user name on command line.
1 parent d55d68f commit 0e66ba80a3d97b57c9c6882e2826dc2fcaffdb0e
@toor toor authored on 12 Feb 2013
Showing 1 changed file
View
58
rootx
#!/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 = _ ]
DISPLAY=localhost:10.0
 
 
xrootBADARGS=FALSE
case $#
in
 
1)
;;
 
2)
DISPLAY=$2
;;
 
*)
echo "usage: . rootx user [display]"
xrootBADARGS=TRUE
;;
 
esac
 
 
if [ $xrootBADARGS != TRUE ]
then
DISPLAY=localhost:10.0
 
else
DISPLAY=$1
cp -pv /home/$1/.Xauthority /root/
export DISPLAY
 
fi
 
echo "Make sure you sourced me!"
cp -p /home/tundra/.Xauthority /root/
export DISPLAY