#!/bin/sh ######################################################################### # Copy the Digital Systems Laboratory setup files # ######################################################################### # This script copies all of the setup files on the Digital Systems # Laboratory Companion CD-ROM into a destination directory (usually # "/etc/skel" or "~", the home directory). You should read through this # script, as it may well need to be modified to suit local conditions. # Caveat emptor! # # [JNZ] Modified 25-Mar-2003 # # Written by John Zaitseff and released into the public domain. set +e # Break on errors O=`basename $0` # Name of the script umask 022 if [ $# -ne 2 ]; then echo "$O: Copy the Digital Systems Laboratory setup files" echo echo "Syntax:" echo " $O srcdir dstdir" echo echo "A typical invocation would be:" echo " $O /mnt/cdrom /etc/skel" exit 0 fi # Function to check if a directory exists checkdir() { if [ ! -d $1 ]; then echo "$O: $1: No such directory" 1>&2 exit 1 fi } # Function to selectively make a directory makedir() { if [ ! -d $1 ]; then mkdir -p $1 echo "Created $1" fi } # Function to copy a single file and make it read/writable # (Files copied from a CD-ROM are, by default, non-writable for the owner) copy() { src=$1 dst=$2 if [ -d $dst ]; then dst=$dst/`basename $src` fi cp $src $dst chmod u+w $dst echo "Copied file to $dst" } # Some sanity checks... checkdir $2 # Check if destination exists checkdir $1 # Check if source exists checkdir $1/unsw/common/labsetup-linux srcdir=$1/unsw/common/labsetup-linux dstdir=$2 checkdir $srcdir/home-config checkdir $srcdir/kde-desktop checkdir $srcdir/kate-syntax checkdir $srcdir/other # Select KDE as the default desktop environment copy $srcdir/other/dot.xsession $dstdir/.xsession # makedir $dstdir/.gnome2 # Not created by default # copy $srcdir/other/gdm $dstdir/.gnome2/gdm # Not copied by default # copy $srcdir/other/dot.wmrc $dstdir/.wmrc # Not copied by default # Copy home directory configuration files copy $srcdir/home-config/dot.bashrc $dstdir/.bashrc copy $srcdir/home-config/dot.bash_profile $dstdir/.bash_profile copy $srcdir/home-config/dot.bash_logout $dstdir/.bash_logout copy $srcdir/home-config/dot.gdbtkinit $dstdir/.gdbtkinit copy $srcdir/home-config/dot.komodo $dstdir/.komodo # Copy the KDE Desktop files makedir $dstdir/Desktop copy $srcdir/kde-desktop/Home.desktop $dstdir/Desktop/Home.desktop copy $srcdir/kde-desktop/Shell.desktop $dstdir/Desktop/Shell.desktop copy $srcdir/kde-desktop/Editor.desktop $dstdir/Desktop/Editor.desktop copy $srcdir/kde-desktop/DSL-Readme.desktop $dstdir/Desktop/DSL-Readme.desktop copy $srcdir/kde-desktop/ARM-ARM.desktop $dstdir/Desktop/ARM-ARM.desktop copy $srcdir/kde-desktop/dot.directory $dstdir/Desktop/.directory # Copy the syntax files for the Kate editor makedir $dstdir/.kde/share/apps/kate/syntax copy $srcdir/kate-syntax/assembler.xml $dstdir/.kde/share/apps/kate/syntax/assembler.xml copy $srcdir/kate-syntax/language.dtd $dstdir/.kde/share/apps/kate/syntax/language.dtd copy $srcdir/kate-syntax/makefile.xml $dstdir/.kde/share/apps/kate/syntax/makefile.xml makedir $dstdir/.kde/share/config copy $srcdir/kde-config/katerc $dstdir/.kde/share/config/katerc copy $srcdir/kde-config/katesyntaxhighlightingrc $dstdir/.kde/share/config/katesyntaxhighlightingrc