File: wordpress.preinst

package info (click to toggle)
wordpress 6.8.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 134,984 kB
  • sloc: javascript: 501,260; php: 293,711; cs: 6,126; sh: 457; xml: 22; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e

case "$1" in
    upgrade)
	if dpkg --compare-versions "$2" lt 5.8.1+dfsg1-2; then
	    # Move the incorrectly placed AppArmor file
	    if [ -d /etc/apparmor.d/apache2.d/wordpress ]; then
		mv  /etc/apparmor.d/apache2.d/wordpress /etc/apparmor.d/apache2.d/wordpress.old
	        if [ -e /etc/apparmor.d/apache2.d/wordpress.old/wordpress.apparmor ]; then
		    mv /etc/apparmor.d/apache2.d/wordpress.old/wordpress.apparmor /etc/apparmor.d/apache2.d/wordpress.tmp
		fi
		# Try to remove the old directory but ignore if it fails
		rmdir /etc/apparmor.d/apache2.d/wordpress.old || true
	    fi
	fi
    ;;
esac

#DEBHELPER#