forked from billm/pfsense-tools-centipede-slbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cvs_sync.sh
58 lines (51 loc) · 1.59 KB
/
cvs_sync.sh
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
#!/bin/sh
# cvs_sync
# Written by Scott Ullrich
# (C)2005 Scott Ullrich
# Part of the pfSense project
# For users of cvs accounts to keep your test machine up to date
#
# Usage example: setenv CVSUSER sullrich && ./cvs_sync.sh
# setenv CVSUSER sullrich && ./cvs_sync.sh update
if [ "$CVSUSER" = "" ]; then
echo
echo "You must export the variable CVSUSER as your cvs login name"
echo
echo "Example: setenv CVSUSER sullrich && ./cvs_sync.sh"
echo
exit
fi
# Temporary directory where we will check out to.
TMPDIR=/tmp/pfSense/
if [ -r $1 ]; then
rm -rf $TMPDIR
mkdir -p $TMPDIR
cd $TMPDIR/.. && cvs -d:ext:${CVSUSER}@216.135.66.16:/cvsroot co pfSense
else
cd $TMPDIR && cvs -d:ext:${CVSUSER}@216.135.66.16:/cvsroot update -d
fi
cd ${TMPDIR}
find . -name pfSense.tgz -exec rm {} \; 2>/dev/null
rm -rf ${TMPDIR}/conf*
rm ${TMPDIR}usr/local/www/trigger_initial_wizard 2>/dev/null
rm ${TMPDIR}etc/master.passwd 2>/dev/null
rm ${TMPDIR}etc/passwd 2>/dev/null
rm ${TMPDIR}etc/fstab 2>/dev/null
rm ${TMPDIR}etc/ttys 2>/dev/null
rm ${TMPDIR}etc/fstab 2>/dev/null
rm ${TMPDIR}boot/device.hints 2>/dev/null
rm ${TMPDIR}boot/loader.conf 2>/dev/null
rm ${TMPDIR}boot/loader.rc 2>/dev/null
rm -rf ${TMPDIR}conf/ 2>/dev/null
rm -rf ${TMPDIR}cf/ 2>/dev/null
rm -rf ${TMPDIR}root/.shrc
rm -rf ${TMPDIR}root/.tcshrc
echo "Installing new files..."
cd $TMPDIR
for FILE in *
do
DIR=`echo $FILE | cut -d/ -f2`
cd $TMPDIR && install $TMPDIR/$FILE /$DIR/
cd $TMPDIR && cp -P -R $TMPDIR$DIR/* /$DIR/
echo "install $TMPDIR$DIR/* /$DIR/"
done