+ 7_add_www_placeholder.sh

This commit is contained in:
fro
2025-10-28 15:14:49 -05:00
parent 37050cdd55
commit 51e93720a3
2 changed files with 29 additions and 0 deletions

View File

@@ -32,5 +32,6 @@ wget ${base_url_scr}/3_create_user.sh
wget ${base_url_scr}/4_acmesh.sh
wget ${base_url_scr}/5_https.sh
wget ${base_url_scr}/6_add_www_root.sh
wget ${base_url_scr}/7_add_www_placeholder.sh
chmod 755 /tmp/*.sh

28
scr/7_add_www_placeholder.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# add a placeholder file to a specific domain / frode klevstul / oct 2025
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$EUID" -ne 0 ]
then echo "error: run as 'root'"
exit
fi
this_file_name=`basename "$0"`
if [ $# -ne 2 ]; then
echo usage: $this_file_name [USERNAME] [BARE_DOMAIN]
exit 1
fi
username=$1
domain=$2
base_url_www=https://gt.op.fo/fro/lnxPub/raw/branch/master/srv/cmn/www
cd /tmp/
wget -O favicon.ico ${base_url_www}/${domain}/favicon.ico
wget -O index.html ${base_url_www}/${domain}/index.html
wget -O robots.txt ${base_url_www}/${domain}/robots.txt
cp favicon.ico index.html robots.txt /var/www/${domain}
chown ${username}:${username} /var/www/${domain}/*.*