rendered paste body#! bash
#####################################################################
# Name: rs-gdm.sh Author: Nyle E. Davis #
# Created: 12/20/07 Modified: 12/21/07 #
# Purpose: Automation of gdm/xorg testing for various changes #
# in the xorg.conf file. #
# Mod: Added actions >> restore << and >> setup <<. #
# Files: xorg.conf current gdm/xorg config file. #
# xorg.conf.backup edited gdm/xorg config file. #
# xorg.conf.failsafe reversion gdm/xorg config file. #
# xorg.conf.old rev backup gdm/xorg config file. #
# Xorg.0.log gdm/xorg activity log file. #
# Xorg.0.log.backup gdm/xorg backup log file. #
# Actions: '' restore to the failsafe version. #
# 'setup' setup to run this script, without #
# restart, by making the copies of #
# the original files. #
# 'try' run the changes made to the edited #
# xorg.conf.backup file. #
# 'restore' after running the dpkg-reconfigure #
# and failing the test, restore to #
# previous config. #
#####################################################################
echo "Var => $1 \n"
if test $1 = 'setup'
then
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
cp /etc/X11/xorg.conf.failsafe /etc/X11/xorg.conf.old
else
if test $1 = 'try'
then
cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
elif test $1 = 'restore'
cp /etc/X11/xorg.conf.old /etc/X11/xorg.conf.failsafe
cp /etc/X11/xorg.conf.failsafe /etc/X11/xorg.conf
else
cp /var/log/Xorg.0.log /var/log/Xorg.0.log.backup
cp /etc/X11/xorg.conf.failsafe /etc/X11/xorg.conf
fi
/etc/init.d/gdm restart
fi