5c41319c83
Change-Id: I65ed7f3a0d1b6e58bc8377932d7c39db21d1b422
50 líneas
1.2 KiB
Bash
Archivo Ejecutable
50 líneas
1.2 KiB
Bash
Archivo Ejecutable
#!/bin/bash
|
|
|
|
rm_ldconfig() {
|
|
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
|
|
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
|
rm -f /etc/ld.so.conf.d/x86_64-libamd_smi_lib.conf
|
|
ldconfig
|
|
fi
|
|
}
|
|
|
|
rm_pyc() {
|
|
# remove pyc files generated by python
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/__pycache__
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi/__pycache__
|
|
}
|
|
|
|
rm_logFolder() {
|
|
rm -rf /var/log/amd_smi_lib
|
|
}
|
|
|
|
return_logrotateToOrigConfig() {
|
|
local logrotateConfFile=/etc/logrotate.d/amd_smi.conf
|
|
if [ -f $logrotateConfFile ]; then
|
|
rm -rf "$logrotateConfFile"
|
|
fi
|
|
if [ -f /etc/cron.hourly/logrotate ]; then
|
|
mv /etc/cron.hourly/logrotate /etc/cron.daily/logrotate
|
|
fi
|
|
if [ -f /lib/systemd/system/logrotate.timer.backup ]; then
|
|
cp /lib/systemd/system/logrotate.timer.backup /lib/systemd/system/logrotate.timer
|
|
rm -rf /lib/systemd/system/logrotate.timer.backup
|
|
systemctl reenable --now logrotate.timer
|
|
fi
|
|
}
|
|
|
|
|
|
case "$1" in
|
|
( remove | upgrade)
|
|
rm_ldconfig
|
|
rm_pyc
|
|
rm_logFolder
|
|
return_logrotateToOrigConfig
|
|
;;
|
|
( purge )
|
|
;;
|
|
( * )
|
|
exit 0
|
|
;;
|
|
esac
|