From 9b49564c2900efc324a149f83f1b4dcb98706f64 Mon Sep 17 00:00:00 2001 From: Bread <103989916+breadtf@users.noreply.github.com> Date: Sat, 27 Apr 2024 09:15:30 +0100 Subject: [PATCH] Fix overwriting index.html --- httpd/DEBIAN/postinst | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/httpd/DEBIAN/postinst b/httpd/DEBIAN/postinst index 74f54f3..a2bf7de 100755 --- a/httpd/DEBIAN/postinst +++ b/httpd/DEBIAN/postinst @@ -1,18 +1,19 @@ #!/bin/bash mkdir -p /var/www/html -touch /var/www/html/index.html -echo "Welcome to" `hostname`" W3 server" >/var/www/html/index.html -echo "

Welcome to" `hostname` "

" >>/var/www/html/index.html -echo "This server has just been installed, and no local -data is currently available. Edit me! -Watch this space... -

Information elsewhere

-For other information, -select this link. -

-

Server Manager
" >> /var/www/html/index.html - +if [ ! -f /var/www/html/index.html ]; then + touch /var/www/html/index.html + echo "Welcome to" `hostname`" W3 server" >/var/www/html/index.html + echo "

Welcome to" `hostname` "

" >>/var/www/html/index.html + echo "This server has just been installed, and no local + data is currently available. Edit me! + Watch this space... +

Information elsewhere

+ For other information, + select this link. +

+

Server Manager
" >> /var/www/html/index.html +fi sudo systemctl enable --now httpd