updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / squidwall / install
blob8dc5e0119d58b2dc47f9d1dc9a17bd69b0157391
2 back_it_up() {
3   dir="$1"
4   d=`date "+%Y-%m-%d @ %H:%M:%S"`
5   backup="/etc/squidwall/backup/$d"
6   file=`basename "$dir"`
7   mkdir -p "$backup"
8   cd "$dir"
9   tar czf "$backup/$file.tar.gz" .
10   rm -rf "$dir"
11   echo "==> backup of directory $dir is @ $backup"
14 pre_upgrade() {
16   # backup the configuration
17   test -d /etc/squidwall && \
18         back_it_up /etc/squidwall
20   # backup the webinterface
21   test -d /home/httpd/html/inet && \
22         back_it_up /home/httpd/html/inet
24   test -h /home/httpd/html/inet && \
25         back_it_up /home/httpd/html/inet
27   # backup the webinterface (was here in 0.2a)
28   test -d /home/httpd/html/inet-intern && \
29         back_it_up /home/httpd/html/inet-intern
31   cat << EOF
33 Please adjust the new files and direcories in /etc/squidwall by hand ...
35 /TR 2005-12-09
36 EOF
39 pre_install() {
40   pre_upgrade $1 $2
43 op=$1
44 shift
46 $op $*