1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/bin/sh -e
# A script to check gup consistency
gup=/var/lib/gup
# the username that gup runs as
gup_uid=gup
def=$gup/default
# you can use this file to override the default paths
if [ -f /etc/gup.paths ]; then
. /etc/gup.paths
fi
echo "Checking contents of $gup/..."
if [ ! -e $def/global.header ]; then
echo ' Missing global header!'; exit 1
fi
if [ ! -e $def/header ]; then
echo ' Missing default header!'; exit 1
fi
if [ ! -e $def/trailer ]; then
echo ' Missing default trailer!'; exit 1
fi
#if [ ! -e $def/global.trailer ]; then
# echo 'Missing global trailer!'; exit 1
#fi
cd $gup/sites
for h in *; do
echo "Checking site $h..."
# header
if [ ! -e $h/header ]; then
echo " Linking default/header -> $h/header"
ln -s $def/header $h/header
fi
# body
if [ ! -e $h/groups -a -e $def/groups ]; then
echo " Copying basic groups entry -> $h/groups"
cp $def/groups $h/groups
# chown $gup_uid $h/groups
fi
# trailer
if [ ! -e $h/trailer ]; then
echo " Linking default/trailer -> $h/trailer"
ln -s $def/trailer $h/trailer
fi
# exclusions
if [ ! -e $h/exclude -a -e $def/exclude ]; then
echo " Linking default/exclude -> $h/exclude"
ln -s $def/exclude $h/exclude
fi
done
|