bash script for getting user profiles ready to go

This script is to be run as root…but the 2nd line (1st functional line) doesn’t work because root has nothing in .gconf

#!/bin/bash

cp -R ~/.gconf /etc/skel/

echo “<?xml version=\”1.0\”?>
<gconf>
<entry name=\”frequency_get_upgrades\” mtime=\”1251122031\” type=\”int\” value=\”0\”/>
<entry name=\”auto_update\” mtime=\”1251122029\” type=\”string\”>
<stringvalue>security</stringvalue>
</entry>
<entry name=\”frequency_get_updates\” mtime=\”1251222859\” type=\”int\” value=\”86400\”/>
</gconf>” >> /etc/skel/.gconf/apps/gnome-packagekit/update-icon/%gconf.xml

echo “Enter Username (person getting computer)”
read userftw

useradd $userftw
echo password | passwd –stdin $userftw

useradd douglasawh

echo “$userftw ALL=(ALL) ALL” >> /etc/sudoers
echo ‘douglasawh ALL=(ALL) ALL’ >> /etc/sudoers

yum -y remove evolution transmission gnome-disk-utility

yum -y install tsclient gconf-editor

sh vpnsetup.sh

echo “\nIf you have the time, run yum -y upgrade. kthxbai”

This is slightly different than the one I’m using just because it’s probably not the safest thing in the world to have all the usernames out of there.

We may add more to the script later, but right now we don’t have a lot we want to do. All these users need to be able to do is remote desktop, but we also want to make sure they are getting security updates and some other minor things that should be apparent in the script.

All of this would be easier if we were still using UCK or reconstructor in ubuntu, but due to Spacewalk, we are moving to Fedora.

Advertisements

4 Responses

  1. #!/bin/bash

    mkdir -p /etc/skel/.gconf/apps/gnome-packagekit/update-icon/

    cat > /etc/skel/.gconf/apps/gnome-packagekit/update-icon/%gconf.xml << EOF

    security

    EOF

    echo “Enter Username (person getting computer)”
    read userftw

    useradd $userftw
    echo password | passwd –stdin $userftw

    useradd smcdade
    useradd dwhitfie

    echo “$userftw ALL=(ALL) ALL” >> /etc/sudoers
    echo ‘douglasawh ALL=(ALL) ALL’ >> /etc/sudoers

    yum -y remove evolution transmission gnome-disk-utility

    yum -y install tsclient gconf-editor

    sh vpnsetup.sh

    echo -e “\nIf you have the time, run yum -y upgrade. kthxbai”

  2. not really sure if this should be a new post or not, but the saga continues. Initially on boot after a fresh install of Fedora 11 (no updates) I get

    Failed to access configuration source(s): Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details – 1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)

    when trying to run

    gconftool-2 –config-source xml:readwrite:/etc/gconf/gconf.xml.system –type int –set /apps/gnome-packagekit/update-icon/frequency_get_upgrades 0

    gconftool-2 –config-source xml:readwrite:/etc/gconf/gconf.xml.system –type string –set /apps/gnome-packagekit/update-icon/auto_update “security”

  3. What are you trying to run with that code?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: