Files
srv-pub/scr/7_add_www_placeholder.sh

36 lines
912 B
Bash
Raw Normal View History

2025-10-28 15:14:49 -05:00
#!/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
2025-12-09 19:44:28 -05:00
base_url_www=https://gi.op.fo/fro/srv-pub/raw/branch/trunk/www
2025-10-28 15:14:49 -05:00
cd /tmp/
2025-10-28 15:16:49 -05:00
wget -O favicon.ico ${base_url_www}/favicon.ico
2025-10-28 16:50:29 -05:00
if [[ ${domain} == "default" ]]; then
wget -O index.html ${base_url_www}/default.html
else
wget -O index.html ${base_url_www}/index.html
fi
2025-10-28 15:16:49 -05:00
wget -O robots.txt ${base_url_www}/robots.txt
2025-10-28 15:14:49 -05:00
cp favicon.ico index.html robots.txt /var/www/${domain}
chown ${username}:${username} /var/www/${domain}/*.*
2025-10-28 16:57:00 -05:00
ls -al /var/www/${domain}/