View Single Post
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#5
Originally Posted by XenGi View Post
So in my postinst.ex file I have now the following code:

Code:
[...]
case "$1" in
    configure)
        mkdir -p /etc/myapp/
        echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" > /etc/myapp/config.xml
        echo "<root>" >> /etc/myapp/config.xml
        echo "</root>" >> /etc/myapp/config.xml
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac
[...]
And that in my postrm.ex file:

Code:
case "$1" in
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        rm -r /etc/myapp/
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac
Is that correct? I haven't tested it.
i think u gotta use /myapp without / at the end