forked from Lainports/freebsd-ports
Bareos (BackupArchivingRecoveryOpenSourced) is a reliable network open source software to backup, archive and restore files from all major operating systems. The fork was founded 2010 out of the bacula.org project. The fork has been actively developed and many new features have been added. WWW: http://www.bareos.org/
30 lines
717 B
Bash
30 lines
717 B
Bash
#!/bin/sh
|
|
|
|
PATH=/bin:/usr/bin:/usr/sbin
|
|
|
|
# Note how to delete UID/GID
|
|
USER=%%BAREOS_USER%%
|
|
GROUP=%%BAREOS_GROUP%%
|
|
UID=%%BAREOS_UID%%
|
|
GID=%%BAREOS_UID%%
|
|
BACULA_DIR=%%BAREOS_DIR%%
|
|
|
|
TMPFILE=/tmp/services-$RANDOM-$$
|
|
|
|
case "$2" in
|
|
"DEINSTALL")
|
|
# Delete entries in /etc/services
|
|
sed -e '/# Bareos port start/,/# Bareos port end/{' \
|
|
-e 'd' \
|
|
-e '}' /etc/services > $TMPFILE
|
|
mv -f $TMPFILE /etc/services
|
|
|
|
if [ -d ${BAREOS_DIR} ]; then
|
|
echo "Check if ${BAREOS_DIR} is empty and delete it to permanently remove the bareos port."
|
|
fi
|
|
|
|
if pw groupshow "${USER}" 2>/dev/null 1>&2; then
|
|
echo "To delete Bareos group permanently, use 'pw groupdel ${GROUP}'"
|
|
fi
|
|
;;
|
|
esac
|