summarylogtreecommitdiffstats
path: root/adsklicensing.install
blob: c12ee81f0fc044a4c4a87f79d0f0a72d12c1b575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
	getent group adsklic &>/dev/null || groupadd adsklic
	id -u adsklic &>/dev/null || useradd -M -r -g adsklic adsklic -d / -s /usr/bin/nologin

	mkdir -p /var/opt/Autodesk/AdskLicensingService
	chown adsklic:adsklic /var/opt/Autodesk/AdskLicensingService
}

pre_remove() {
	systemctl stop adsklicensing.service
	systemctl disable adsklicensing.service

	if [ -d "/opt/Autodesk/AdskLicensing/${1}" ]
	then
		rm -rf "/opt/Autodesk/AdskLicensing/${1}"
		rmdir --ignore-fail-on-non-empty /opt/Autodesk/AdskLicensing
		rmdir --ignore-fail-on-non-empty /opt/Autodesk
	fi
}

post_remove() {
	userdel adsklic
}