diff --git a/pkg/rpm/scriptlets.toml b/pkg/rpm/scriptlets.toml index 9886bd9..b2d4200 100644 --- a/pkg/rpm/scriptlets.toml +++ b/pkg/rpm/scriptlets.toml @@ -1,18 +1,22 @@ post_install_script = ''' #!/bin/bash -e -if [ $1 -eq 1 ] ; then - # Initial installation - # Create symbolic links - ln -s /usr/bin/dnst /usr/bin/ldns-nsec3-hash +FORCE= +if [ $1 -eq 2 ]; then + # Upgrade + FORCE=-f fi + +# Create symbolic links +ln -s ${FORCE} /usr/bin/dnst /usr/bin/ldns-nsec3-hash ''' post_uninstall_script = ''' #!/bin/bash -e #RPM_SYSTEMD_MACROS# -if [ $1 -ge 1 ] ; then +if [ $1 -eq 0 ] ; then + # Uninstallation # Remove symbolic links rm -f /usr/bin/ldns-nsec3-hash fi