#!/bin/bash NGINX_CONF_FILE=/etc/nginx/sites-available/astroport NGINX_ROOT=~/.zen/webui USER_GROUP=`groups | awk '{print $1}'` #sudo adduser --home $HOME --no-create-home --disabled-password --disabled-login --quiet --gecos "" astroport #sudo adduser astroport $USER_GROUP sudo chgrp -R www-data ~/{.zen,.ipfs,astroport} sudo chmod -R g+rw ~/{.zen,.ipfs,astroport} echo ~ | tee ../conf/home_dir.txt rm ../{astrXbian,astroport,swarm,me} ln -s ../astrXbian ../astrXbian ln -s ../../astroport ../astroport ln -s ../ipfs_swarm ../swarm ln -s ../ipfs ../me sudo rm $NGINX_CONF_FILE cd /etc/nginx/sites-enabled sudo ln -s ../sites-available/astroport astroport sudo dd of=$NGINX_CONF_FILE << EOF server { listen 80 default_server; listen [::]:80 default_server; root $NGINX_ROOT; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files \$uri \$uri/ =404; } index index.php; # pass PHP scripts to FastCGI server location ~ \.php$ { include snippets/fastcgi-php.conf; # With php-fpm (or other unix sockets): fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # With php-cgi (or other tcp sockets): #fastcgi_pass 127.0.0.1:9000; } } EOF sudo systemctl restart nginx echo "" echo "Press any key to finish installation" read exit 0