# -*- shell-script -*- if [ "$1" = 'purge' ] ; then # If runscript was never invoked, there will be no files # in this directory, and `dpkg' will remove it. In this case, # we have nothing to do. for supervise in "/var/lib/runit/supervise/#NAME#" \ "/var/lib/runit/log/supervise/#NAME#" ; do if [ -d "$supervise" ] ; then # Actually only `down' may be absent, but it does not # matter. for file in control lock ok pid stat status down ; do rm -f "$supervise/$file" done # It should be empty now. If it is not, it means that # system administrator put something there. It is very # stupid, but will of user is sacred, and directory is # left as-is in such case. # # NOTE: Non-POSIX option is used. The day coreutils will # no longer be essential, it will require a fix. rmdir --ignore-fail-on-non-empty "$supervise" fi done fi # Local Variables: # eval: (sh-set-shell "sh" t nil) # End: