Imported Upstream version 3.3.2
[debian/amanda] / packaging / sun-pkg / client / postremove.src
1 #!/bin/sh
2
3 LOGFILE=`mktemp /tmp/amanda-client-rm-log.XXXXXXXXXXX`
4 if [ $? -ne 0 ]; then
5         echo "Unable to create log file!"
6         exit 1
7 fi
8 amanda_user=amandabackup
9 amanda_group=disk
10 # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime.
11 # Unfortunately, it messes things up to have basedir="/".
12 [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR}
13 AMANDAHOMEDIR=${basedir}%%AMANDAHOMEDIR%%
14 os=SunOS
15 dist=%%DISTRO%%
16
17 LOGDIR=${basedir}%%LOGDIR%%
18 SYSCONFDIR=${basedir}/etc
19
20 # ---------- Common functions ------------
21 # see packaging/common/ in the source tree
22 %%COMMON_FUNCTIONS%%
23 %%POST_RM_FUNCTIONS%%
24
25 # -------- End Common functions ----------
26
27 rel=`uname -r`
28
29 case $rel in
30     5.8|5.9)
31         if check_inetd "amanda"; then
32             rm_inetd "amanda" || { \
33             logger "Warning: Did not successfully remove amanda from SMF.";
34                 exit 1; }
35             reload_inetd
36         fi
37     ;;
38     5.10)
39         if check_smf "amanda"; then
40             rm_smf "amanda" || { \
41                 logger "Warning: Did not successfully remove amanda from SMF.";
42                 exit 1; }
43         fi
44     ;;
45 esac
46
47 logger "Amanda Client removed."