diff options
-rw-r--r-- | proteanos-branding.pkg/control | 6 | ||||
-rw-r--r-- | proteanos-branding.pkg/docs | 0 | ||||
-rw-r--r-- | proteanos-branding.pkg/postinst | 20 | ||||
-rw-r--r-- | proteanos-branding.pkg/prerm | 14 |
4 files changed, 40 insertions, 0 deletions
diff --git a/proteanos-branding.pkg/control b/proteanos-branding.pkg/control new file mode 100644 index 0000000..e21a5ea --- /dev/null +++ b/proteanos-branding.pkg/control @@ -0,0 +1,6 @@ +Architecture: all +Platform: all +Depends: busybox (>= 1.21.1-8) +Description: ProteanOS branding + This package provides branding files for the ProteanOS BusyBox/Linux-libre + distribution. diff --git a/proteanos-branding.pkg/docs b/proteanos-branding.pkg/docs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/proteanos-branding.pkg/docs 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 diff --git a/proteanos-branding.pkg/prerm b/proteanos-branding.pkg/prerm new file mode 100644 index 0000000..11ba0a0 --- /dev/null +++ b/proteanos-branding.pkg/prerm @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "x${1}" = 'xremove' ]; then + if [ -f /usr/share/branding/www/SHA256SUMS ]; then + if [ -f /var/www/index.html ] && \ + sha256sum -cs /usr/share/branding/www/SHA256SUMS + then + # /var/www/index.html exists and hasn't been modified by + # the user. + rm /var/www/index.html + fi + rm /usr/share/branding/www/SHA256SUMS + fi +fi |