summaryrefslogtreecommitdiff
path: root/sysutils/bsdsar/pkg-install
blob: 49338687775ee5901430cb23708e9decebb074d9 (plain) (blame)
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
#!/bin/sh
#

PKG_PREFIX=${PKG_PREFIX:-/usr/local}

# Verify proper execution
#
if [ $# -ne 2 ]; then
    echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
    exit 1
fi

# Verify/process the command
#
case $2 in
    PRE-INSTALL)
        : nothing to pre-install for this port
        ;;
    POST-INSTALL)
	echo "Adding 2 lines to /etc/crontab ..."
	echo "# bsdsar execution" >> /etc/crontab
	echo "20,40   8-18    *       *       *       root    $PKG_PREFIX/bin/bsdsar_gather /var/log" >> /etc/crontab
	echo "0       *       *       *       *       root    $PKG_PREFIX/bin/bsdsar_gather /var/log" >> /etc/crontab
        ;;
    *)
        echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
        exit 1
        ;;
esac

exit 0