1
0
mirror of https://github.com/jordansissel/fpm synced 2025-02-23 01:51:16 +01:00
fpm/templates/pleaserun/scripts/before-remove.sh
Jordan Sissel 0a2badb1c8 Refactor. Also now we attempt cleanup upon package removal.
The `install.sh` will generate a cleanup.sh script that is executed when
the package is removed.
2016-05-15 04:09:19 -07:00

13 lines
303 B
Bash

#!/bin/sh
source="<%= attributes[:prefix] %>"
if [ -f "$source/cleanup.sh" ] ; then
echo "Running cleanup to remove service for package <%= attributes[:name] %>"
set -e
sh "$source/cleanup.sh"
# Remove the script also since the package installation generated it.
rm "$source/cleanup.sh"
fi