summaryrefslogtreecommitdiff
blob: 84fe795d5bd9233d8f6b15c1c403de1391e00739 (plain)
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
#!/bin/bash
#
# /usr/bin/popfile
#		Shell script wrapper around the popfile perl script
#
# Author	Stuart Herbert
#		(stuart@gentoo.org)
#
# Copyright	Released into the public domain
#
# ------------------------------------------------------------------------

POPFILE_DIR=/usr/share/popfile
POPFILE_PL=popfile.pl

if [[ `id -u` != 0 ]] ; then
	echo "*** error: You must be root to run popfile" >&2
	exit 1
fi

if [[ ! -d $POPFILE_DIR ]] ; then
	echo "*** error: Directory $POPFILE_DIR does not exist" >&2
	echo "***        Is popfile installed?"
	exit 1
fi

if [[ ! -e $POPFILE_DIR/$POPFILE_PL ]] ; then
	echo "*** error: popfile.pl is missing or not executable" >&2
	exit 1
fi

cd $POPFILE_DIR
exec ./$POPFILE_PL