Skip to content

Commit

Permalink
Fix overwriting index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
breadtf authored Apr 27, 2024
1 parent 77f774e commit 9b49564
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions httpd/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/bash

mkdir -p /var/www/html
touch /var/www/html/index.html
echo "<title>Welcome to" `hostname`" W3 server</title>" >/var/www/html/index.html
echo "<h1>Welcome to" `hostname` "</h1>" >>/var/www/html/index.html
echo "This server has just been installed, and no local
data is currently available. Edit me!
Watch this space...
<h2>Information elsewhere</h2>
For other information,
<a href=\"http://info.cern.ch/\">select this link</a>.
<p>
<address>Server Manager<address>" >> /var/www/html/index.html

if [ ! -f /var/www/html/index.html ]; then
touch /var/www/html/index.html
echo "<title>Welcome to" `hostname`" W3 server</title>" >/var/www/html/index.html
echo "<h1>Welcome to" `hostname` "</h1>" >>/var/www/html/index.html
echo "This server has just been installed, and no local
data is currently available. Edit me!
Watch this space...
<h2>Information elsewhere</h2>
For other information,
<a href=\"http://info.cern.ch/\">select this link</a>.
<p>
<address>Server Manager<address>" >> /var/www/html/index.html
fi
sudo systemctl enable --now httpd


0 comments on commit 9b49564

Please sign in to comment.