+ / 6_add_www_root.sh

This commit is contained in:
fro
2025-10-28 14:50:36 -05:00
parent 89c68787a0
commit 116a6c21b8
2 changed files with 24 additions and 2 deletions

View File

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

23
scr/6_add_www_root.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# add www root folder for 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
mkdir -p /var/www/$domain
chown $username:$username /var/www/$domain