6e52a113a2
When uninstalling the RDC application - the user is greeted with an annoying "Failed to stop rdc.service..." message if the RDC is not running. This change makes sure RDC is active before trying to stop it. Change-Id: I6fa57bfd4b9c348514cd6c38e60ed3930d32b62c Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
32 строки
619 B
Bash
Исполняемый файл
32 строки
619 B
Bash
Исполняемый файл
#!/bin/bash
|
|
|
|
stop_rdc() {
|
|
#stop RDC service if systemd exists and service is running
|
|
if [ -d /run/systemd/system ] && $( systemctl is-active --quiet rdc ); then
|
|
systemctl stop rdc
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
rm_rdc_service() {
|
|
local LINK=@DISTRO_ROOT@/rdc.service
|
|
if [ -L $LINK ]; then
|
|
unlink $LINK
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
reload_systemd() {
|
|
if [ -d /run/systemd/system ]; then
|
|
systemctl daemon-reload
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
if [ $1 -le 1 ]; then
|
|
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
|
|
stop_rdc
|
|
rm_rdc_service
|
|
reload_systemd
|
|
fi
|