| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
period="daily hourly monthly weekly" |
| 6 |
operation="balance defrag scrub trim" |
| 7 |
|
| 8 |
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then |
| 9 |
for i in $period; do |
| 10 |
for op in $operation; do |
| 11 |
if [ -L "/etc/cron.$i/btrfs-$op" ] \ |
| 12 |
&& [ ! -e "/etc/cron.$i/btrfs-$op" ]; then |
| 13 |
rm "/etc/cron.$i/btrfs-$op" |
| 14 |
fi |
| 15 |
if [ -L "/etc/systemd/system/timers.target.wants/btrfs-$op.timer" ]; then |
| 16 |
rm "/etc/systemd/system/timers.target.wants/btrfs-$op.timer" |
| 17 |
fi |
| 18 |
if [ -L "/etc/systemd/system/btrfs-$op.timer.d/schedule.conf" ]; then |
| 19 |
rm "/etc/systemd/system/btrfs-$op.timer.d/schedule.conf" |
| 20 |
rmdir "/etc/systemd/system/btrfs-$op.timer.d" |
| 21 |
fi |
| 22 |
done |
| 23 |
done |
| 24 |
fi |
| 25 |
if [ -L "/etc/systemd/system/multi-user.target.wants/btrfsmaintenance-refresh.service" ]; then |
| 26 |
rm "/etc/systemd/system/multi-user.target.wants/btrfsmaintenance-refresh.service" |
| 27 |
fi |
| 28 |
if [ -L "/etc/systemd/system/multi-user.target.wants/btrfsmaintenance-refresh.path" ]; then |
| 29 |
rm "/etc/systemd/system/multi-user.target.wants/btrfsmaintenance-refresh.path" |
| 30 |
fi |
| 31 |
|
| 32 |
#DEBHELPER# |
| 33 |
|
| 34 |
exit 0 |