Tuesday, September 28, 2010

Reset user desktop for CentOS

On CentOS, after installing the Oracle OpenOffice.org (OOo), everything works fine. Since by default the PCs have auto update enabled, the users tend to update and this causes the CentOS version of OOo to corrupt the installed OOo.

One way to avoid this is to disable the auto update. Since it is a lab environment, I can easily delete and replace user1 account to remove previous configurations in OOo for user1.

Step 1. Create the 2 simple scripts to disable the auto update and reset the desktop for user1.

goreset.sh
#/bin/bash
echo "Resetting pc:"
chkconfig yum-updatesd off
tmpwatch 0 /tmp
echo "Creating user user1"
userdel -r user1
useradd -m user1
passwd oscc
echo "User created, going to reboot"
reboot

startscript.sh
#!/bin/bash
LOGFILE="./coombreset.log"
echo "Enter server name:"
read SERVER
if [ -e $SERVER ]
then
exit
fi
scp prepare-cooomb-test.sh root@"$SERVER":~
ssh root@"$SERVER" ./goreset.sh
echo $SERVER >> $LOGFILE

Step 2. execute (run) the script named startscript.sh

-end-

No comments: