|
This one's my 'update.sh' script, kept in /home It reads settings from user
ws000
Note that /home/firebird-share is a folder which contains the prefs.js file all
users share. only user ws000 has write permission, so nobody else can change
it.
/home/ws000 also contains a symlink from /home/icewm-shared to
/home/ws000/.icewm This folder contains the ICEWM window manager settings and
menus, and it's read-only for all users other than ws000. I can submit these
later too, if required.
#!/bin/bash
# update.sh: This script is designed to automatically perform non-destructive
# per-user changes and updates.
FIRST=1
LAST=10 # If you go over 999 you must edit the if/else with a -lt 1000 entry
for i in `seq $FIRST $LAST`;
do
# If $FIRST is 1 and $LAST is 16, $USER will be set to values
# ws001 to ws016, sequentially.
if [ $i -lt 10 ]; then
#single-digit number, e.g. ws003
USER="ws00"$i
elif [ $i -lt 100 ]; then
# 2-digit number, e.g. ws013
USER="ws0"$i
else
# 3-digit number, e.g. ws450 (That's some network!)
USER="ws"$i
fi
echo "----------------------"
echo "Modifying: "$USER
echo "----------------------"
# Ensure this user is in the necessary groups
usermod -G users,games $USER
# Remove the MozillaFirebird prefs.js file
# (Shows a non-fatal error if it's not there)
rm /home/$USER/.phoenix/default/`ls /home/$USER/.phoenix/default/`/prefs.js
# Link to a system prefs.js in /home/firebird-share/prefs.js
ln -s /home/firebird-share/prefs.js /home/$USER/.phoenix/default/`ls
/home/$USER/.phoenix/default/`/prefs.js
# -------------------------------------------------
# Add your own stuff here. I use ws000 as the source for all changes,
# so as an example if you install Wine and want to link all ws users
# to the same wine folder, you can do
# (/home/wine is the wine config folder, shared between ws users)
# rm -rf /home/$USER/.wine
# ln -s /home/wine /home/$USER/.wine
cp -R /home/ws000/.scribus /home/$USER/
chown -R $USER.users /home/$USER/.scribus
echo "icewm" > /home/$USER/.wmrc
# OpenOffice setup.
cat /home/ws000/.sversionrc | sed s/ws000/$USER/ > /home/$USER/.sversionrc
chown $USER.users /home/$USER/.sversionrc
cp -R /home/ws000/OpenOffice.org1.1.0 /home/$USER/
chown -R $USER.users /home/$USER/OpenOffice.org1.1.0
mkdir /home/$USER/.openoffice
cp -R /home/ws000/.openoffice/1.1.0 /home/$USER/.openoffice/
chown -R $USER.users /home/$USER/.openoffice
# -------------------------------------------------
done
|