prerm is in crtmpserver-apps 1.0~dfsg-5.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #!/bin/sh
set -e
APPLICATIONS="admin applestreamingclient appselector flvplayback proxypublish samplefactory stresstest vptests"
compare() {
[ $# != 2 ] && exit 1
A=$(md5sum $1 | cut -d' ' -f1)
B=$(md5sum $2 | cut -d' ' -f1)
[ "$A" = "$B" ] && return 0 || return 1
}
do_remove() {
for app in $APPLICATIONS; do
if [ -f "/etc/crtmpserver/applications/$app.lua" ]; then
compare "/etc/crtmpserver/applications/$app.lua" \
"/usr/share/crtmpserver-apps/$app.lua" \
&& rm -f "/etc/crtmpserver/applications/$app.lua"
fi
done
if [ -f "/etc/crtmpserver/conf.d/users.lua" ]; then
compare "/etc/crtmpserver/conf.d/users.lua" \
"/usr/share/crtmpserver-apps/conf.d/users.lua" \
&& rm -f "/etc/crtmpserver/conf.d/users.lua"
fi
if [ -f /etc/crtmpserver/enabled_applications.conf ]; then
compare "/etc/crtmpserver/enabled_applications.conf" \
"/usr/share/crtmpserver-apps/enabled_applications.conf" \
&& rm -f /etc/crtmpserver/enabled_applications.conf
fi
return 0
}
do_purge() {
for app in $APPLICATIONS; do
[ -f "/etc/crtmpserver/applications/$app.lua" ] && \
rm -f "/etc/crtmpserver/applications/$app.lua"
done
[ -f "/etc/crtmpserver/conf.d/users.lua" ] && \
rm -f "/etc/crtmpserver/conf.d/users.lua"
[ -f "/etc/crtmpserver/enabled_applications.conf" ] && \
rm -f "/etc/crtmpserver/enabled_applications.conf"
return 0
}
case "$1" in
remove)
do_remove
;;
purge)
do_remove
do_purge
;;
*)
exit 0
;;
esac
|