Skip to content
Snippets Groups Projects
Commit 40e588e0 authored by Bob Mottram's avatar Bob Mottram
Browse files

website directory

parent 104d81dc
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
lang=$1
dest_dir=$2
PROJECT_NAME=freedombone
......@@ -11,6 +10,16 @@ ONION_ONLY='no'
site_domain=${PROJECT_NAME}.net
site_onion_port=8149
if [ ! -d /root/${PROJECT_NAME}/website ]; then
echo "Directory not found /root/${PROJECT_NAME}/website"
exit 1
fi
dest_dir="/var/www/${site_domain}/htdocs"
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
fi
if [ -f "$CONFIGURATION_FILE" ]; then
ONION_ONLY=$(grep 'ONION_ONLY=' "$CONFIGURATION_FILE" | head -n 1 | awk -F '=' '{print $2}')
fi
......@@ -27,7 +36,7 @@ if [[ "$ONION_ONLY" == 'no' ]]; then
echo ' listen 80;';
echo ' listen [::]:80;';
echo " server_name ${site_domain};";
echo " root /var/www/${site_domain}/htdocs;";
echo " root ${dest_dir};";
echo ' access_log /dev/null;';
echo ' error_log /dev/null;';
echo ' client_max_body_size 20m;';
......@@ -74,7 +83,7 @@ if [[ "$ONION_ONLY" == 'no' ]]; then
echo ' access_log /dev/null;';
echo ' error_log /dev/null;';
echo '';
echo " root /var/www/${site_domain}/htdocs;";
echo " root ${dest_dir};";
echo '';
echo ' index index.html;';
echo '';
......@@ -159,7 +168,7 @@ fi
echo ' access_log /dev/null;';
echo ' error_log /dev/null;';
echo '';
echo " root /var/www/${site_domain}/htdocs;";
echo " root ${dest_dir};";
echo '';
echo ' index index.html;';
echo '';
......@@ -222,10 +231,8 @@ fi
if [ ! "$lang" ]; then
lang='EN'
fi
if [ ! "$2" ]; then
echo 'Specify language and destination directory'
exit 1
fi
cd /root/${PROJECT_NAME}/website || exit 2
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment