Files
rocm-systems/src/RPM_postun.in
T

32 lines
619 B
Bash
Raw Normal View History

2022-12-13 14:37:59 -06:00
#!/bin/bash
2020-11-13 16:13:25 -08:00
stop_rdc() {
2023-05-31 11:35:14 -05:00
#stop RDC service if systemd exists and service is running
if [ -d /run/systemd/system ] && $( systemctl is-active --quiet rdc ); then
2022-12-13 14:37:59 -06:00
systemctl stop rdc
fi
return 0
}
rm_rdc_service() {
2023-01-09 13:18:47 -06:00
local LINK=@DISTRO_ROOT@/rdc.service
if [ -L $LINK ]; then
unlink $LINK
2022-12-13 14:37:59 -06:00
fi
2020-11-13 16:13:25 -08:00
return 0
}
reload_systemd() {
2022-12-13 14:37:59 -06:00
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
2020-11-13 16:13:25 -08:00
return 0
}
if [ $1 -le 1 ]; then
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
2020-11-13 16:13:25 -08:00
stop_rdc
2022-12-13 14:37:59 -06:00
rm_rdc_service
2020-11-13 16:13:25 -08:00
reload_systemd
fi