diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-05 11:35:27 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-05 11:39:59 (EDT) |
commit | 3b80c605f096d3e2ec6dd690904154292262170f (patch) | |
tree | 32bf676cd5aff68990496e9a01bc34032bd07b5d /busybox.pkg/postinst | |
parent | 9de16d22b0ac3cbb74793faa913db889d8151ee5 (diff) |
Let users modify /var/www/index.html.
Diffstat (limited to 'busybox.pkg/postinst')
-rwxr-xr-x | busybox.pkg/postinst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/busybox.pkg/postinst b/busybox.pkg/postinst index fa5e152..07b5c1f 100755 --- a/busybox.pkg/postinst +++ b/busybox.pkg/postinst @@ -15,6 +15,20 @@ if [ "x${1}" = 'xconfigure' ]; then done exec 3>&- fi + if [ "x$(ls -A /var/www/ | head -n 1)" = 'x' ]; then + # There are no files in /var/www/. + cp /usr/share/busybox/www/index.html /var/www/index.html + sha256sum /var/www/index.html >/usr/share/busybox/www/SHA256SUMS + elif [ -f /var/www/index.html ] && \ + [ -f /usr/share/busybox/www/SHA256SUMS ]; then + if sha256sum -cs /usr/share/busybox/www/SHA256SUMS; then + # /var/www/index.html exists and hasn't been modified by + # the user. + cp /usr/share/busybox/www/index.html /var/www/index.html + sha256sum /var/www/index.html \ + >/usr/share/busybox/www/SHA256SUMS + fi + fi if ! [ -f /etc/rc.policy ]; then if [ "x$(cat /etc/proteanos_plat)" = 'xdev' ]; then printf 'disabled\n' >/etc/rc.policy |