#!/bin/sh # # Linux systems keep a user template in /etc/skel, so this # script simply copies the sample.* files there under the # appropriate names. if [ ! -d /etc/skel ]; then echo "The directory /etc/skel does not exist." echo "Please create it and then re-run this script" exit 1 fi if [ ! -w /etc/skel ]; then echo "The directory /etc/skel is not writeable" echo "Please change the protections and re-run this script" exit 2 fi echo "Filling /etc/skel..." INITLIST=`/bin/ls -A1 sample.* | grep -v ~\$` for SAMPLEFILE in $INITLIST do FILENAME=`echo $SAMPLEFILE | sed -e "s/sample//" ` /bin/cp $SAMPLEFILE /etc/skel/${FILENAME} done exit 0