diff --git a/install.sh b/install.sh index 67a68de..34df2e2 100755 --- a/install.sh +++ b/install.sh @@ -19,11 +19,15 @@ fi echo "Copying Systemd units to system directory..." if [ ! -f /etc/ssl/cert.crt ]; then - openssl req -newkey rsa:4096 -x509 -sha256 -days 999 -nodes -out /etc/ssl/cert.crt -keyout /etc/ssl/cert.key \ + $sudo openssl req -newkey rsa:4096 -x509 -sha256 -days 999 -nodes -out /etc/ssl/cert.crt -keyout /etc/ssl/cert.key \ -subj "/C=/ST=/L=/O=/OU=/CN=" fi +if [ -d /etc/nginx ]; then + $sudo cp $run_directory/nginx-blocks/0-http-redirect /etc/nginx/sites-available/0-http-redirect + $sudo ln -s ../sites-available/0-http-redirect /etc/nginx/sites-enabled/0-http-redirect +fi -if [ "$file_browser" = "yes" ]; then +if [ "$filebrowser" = "yes" ]; then $sudo cp $run_directory/systemd-templates/filebrowser.service /etc/systemd/system/ $sudo sed -i -e "s/PH_NAS_USER/$nas_user/g" /etc/systemd/system/filebrowser.service $sudo sed -i -e "s/PH_NAS_DIRECTORY/$nas_location/g" /etc/systemd/system/filebrowser.service