ports/net/xrdp/files/pkg-deinstall.in
Koichiro Iwao 6d78c88cc6 net/xrdp: Fix build with audio/fdk-aac 2.0.0 etc
Submitter's patch has been merged into upstream with minor changes.

Also while here, cleanup some leftovers. This port generates private key
and server certificate in post-install script. Poudriere complains that
these files are left over after deinstall. Now these auto-generated files
will be removed when deinstall. If certificate and private key are replaced
with user's own files, they should be kept.

PR:		233558
Submitted by:	takefu@airport.fm (original version)
Approved by:	mentors (implicit)
Obtained from:	https://github.com/neutrinolabs/xrdp/pull/1257
Sponsored by:	HAW International, Inc.
2018-11-28 08:12:18 +00:00

34 lines
804 B
Bash

#!/bin/sh
# vim:ts=4:sw=4:et
if [ $# -ne 2 ]; then
echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
exit 1
fi
case $2 in
DEINSTALL)
: nothing to do here
;;
POST-DEINSTALL)
RSAKEYS=%%PREFIX%%/etc/xrdp/rsakeys.ini
PRIVATEKEY=%%PREFIX%%/etc/xrdp/key.pem
CERTIFICATE=%%PREFIX%%/etc/xrdp/cert.pem
# if keys are generated during post-install script, remove it
# but do not remove user's keys
for f in $RSAKEYS $PRIVATEKEY $CERTIFICATE;
do
if cmp -s "${f}.sample" "${f}"; then
rm -f "${f}"
fi
rm -f "${f}.sample"
done
;;
*)
echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
exit 1
;;
esac
exit 0