File: arpwatch.preinst

package info (click to toggle)
arpwatch 2.1a11-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 456 kB
  • ctags: 36
  • sloc: perl: 340; makefile: 194; sh: 158
file content (24 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# arpwatch.preinst: v0.02 2001/11/24 KELEMEN Peter <fuji@debian.org>

set -e

#DEBHELPER#

NAME=arpwatch
DBDIR=/var/lib/$NAME
DBFILE=arp.dat
BACKUPDIR=/var/backups
BACKUPNAME=$NAME.dbbackup

[ -d $DBDIR ] || exit 0
[ -f $DBDIR/$DBFILE ] || touch $DBDIR/$DBFILE
[ -d $BACKUPDIR ] || { 
	echo "$NAME: $BACKUPDIR does not exist, ARP database(s) not saved.";
	exit 0
}

echo "$NAME: Saving collected ARP database(s)."
cp -rp $DBDIR $BACKUPDIR/$BACKUPNAME

# End of file.