diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-25 12:16:24 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-25 12:16:24 (EDT) |
commit | 4f365deb31cdbf9da89abb474b3c05f3eb2882c6 (patch) | |
tree | 02c07755c7d284bb956fcc4d53254575e428a84c /proteanos-branding.pkg/postinst | |
parent | e20614706dcd3653d77d16ff54414764026a15b4 (diff) |
proteanos-branding: New binary package.
Diffstat (limited to 'proteanos-branding.pkg/postinst')
-rw-r--r-- | proteanos-branding.pkg/postinst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/proteanos-branding.pkg/postinst b/proteanos-branding.pkg/postinst new file mode 100644 index 0000000..ea2ecad --- /dev/null +++ b/proteanos-branding.pkg/postinst @@ -0,0 +1,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 |