summaryrefslogtreecommitdiffstats
path: root/proteanos-branding.pkg/postinst
blob: ea2ecad22858dee009375a0a8f99fa8f9dccfc48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

if [ "x${1}" = 'xconfigure' ]; then
	if [ "x$(ls -A /var/www/ | head -n 1)" = 'x' ]; then
		# There are no files in /var/www/.
		cp /usr/share/branding/www/index.html /var/www/index.html
		sha256sum /var/www/index.html \
			>/usr/share/branding/www/SHA256SUMS
	elif [ -f /var/www/index.html ] && \
			[ -f /usr/share/branding/www/SHA256SUMS ]; then
		if sha256sum -cs /usr/share/branding/www/SHA256SUMS; then
			# /var/www/index.html exists and hasn't been modified by
			# the user.
			cp /usr/share/branding/www/index.html \
				/var/www/index.html
			sha256sum /var/www/index.html \
				>/usr/share/branding/www/SHA256SUMS
		fi
	fi
fi