summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. 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)
commit3b80c605f096d3e2ec6dd690904154292262170f (patch)
tree32bf676cd5aff68990496e9a01bc34032bd07b5d
parent9de16d22b0ac3cbb74793faa913db889d8151ee5 (diff)
Let users modify /var/www/index.html.
-rwxr-xr-xbuild5
-rwxr-xr-xbusybox.pkg/postinst14
-rw-r--r--changelog3
-rw-r--r--src.share/www/index.html (renamed from src.var/www/index.html)0
4 files changed, 20 insertions, 2 deletions
diff --git a/build b/build
index 6962d5f..41b1fb2 100755
--- a/build
+++ b/build
@@ -62,9 +62,10 @@ install: build
exec 3>&-; \
fi; \
if config_enabled HTTPD; then \
+ install -d -m 0755 dest/usr/share/busybox/www; \
+ install -p -m 0644 ../src.share/www/index.html \
+ dest/usr/share/busybox/www/index.html; \
install -d -m 0755 dest/var/www; \
- install -p -m 0644 ../src.var/www/index.html \
- dest/var/www/index.html; \
fi; \
if config_enabled IFUPDOWN; then \
install -d -m 0755 dest/etc; \
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
diff --git a/changelog b/changelog
index 720177d..52cc0ca 100644
--- a/changelog
+++ b/changelog
@@ -16,6 +16,9 @@ busybox (1.21.1-5) trunk
* Buffer early service initialization output until syslogd is running.
* Make some service scripts a little more robust.
* /etc/init.d/rc.local: New service initialization script.
+ * Let users modify /var/www/index.html. Only install a default
+ version if the user hasn't put anything in /var/www/ or if
+ /var/www/index.html exists and hasn't been modified.
-- "P. J. McDermott" <pj@pehjota.net> Mon, 02 Jun 2014 19:58:21 -0400
diff --git a/src.var/www/index.html b/src.share/www/index.html
index a178911..a178911 100644
--- a/src.var/www/index.html
+++ b/src.share/www/index.html