2023-05-01 19:08:47 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
#set -x
|
|
|
|
|
|
|
|
|
|
rm_logFolder() {
|
|
|
|
|
sudo rm -rf /var/log/rocm_smi_lib
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return_logrotateToOrigConfig() {
|
|
|
|
|
if [ -f /etc/logrotate.d/rocm_smi.conf ]; then
|
|
|
|
|
sudo rm -rf /etc/logrotate.d/rocm_smi.conf
|
|
|
|
|
fi
|
|
|
|
|
if [ -f /etc/cron.hourly/logrotate ]; then
|
|
|
|
|
sudo mv /etc/cron.hourly/logrotate /etc/cron.daily/logrotate
|
|
|
|
|
fi
|
|
|
|
|
if [ -f /lib/systemd/system/logrotate.timer.backup ]; then
|
|
|
|
|
sudo cp /lib/systemd/system/logrotate.timer.backup /lib/systemd/system/logrotate.timer
|
|
|
|
|
sudo rm -rf /lib/systemd/system/logrotate.timer.backup
|
|
|
|
|
sudo systemctl reenable --now logrotate.timer
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-11 19:34:40 -05:00
|
|
|
if [ $1 -le 1 ]; then
|
|
|
|
|
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
|
|
|
|
|
# remove pyc file generated by python
|
|
|
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rocm_smi/__pycache__
|
2023-05-01 19:08:47 -05:00
|
|
|
rm_logFolder
|
|
|
|
|
return_logrotateToOrigConfig
|
2022-08-11 19:34:40 -05:00
|
|
|
fi
|