From 3b8c214dec5134949a9140331fea0a526355a34c Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 30 Jul 2020 15:22:26 +0200 Subject: [PATCH] Fixed oopsie's --- AppendCMS.sh | 7 +++---- AppendModule.sh | 2 +- CMS/nextcloud/MotdNextCloud | 2 +- CMS/nextcloud/conf.sh | 5 +++++ CMS/nextcloud/nginx-conf.sh | 4 +++- installer.sh | 6 +++--- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/AppendCMS.sh b/AppendCMS.sh index 126e507..07918b9 100644 --- a/AppendCMS.sh +++ b/AppendCMS.sh @@ -81,7 +81,6 @@ if [ $IMODE = n ]; then [[ -d "/var/www/"$domain"/html" ]] && msg " This domain already exists on this server, Exiting" 8 78 && exit; if (whiptail --title "Config" --yesno " Does www.${domain} exist in DNS" 8 78); then domainwww=1; else domainwww=0; fi if (whiptail --title "Set sitename?" --yesno "Set sitename to ${domain//./_} ?" 8 78); then - echo "Yes" sitename=${domain//./_} else while true; do @@ -117,8 +116,8 @@ if [ $IMODE = l ]; then done read -p "Set sitename to ${domain//./_}? (y/n)" choice case "$choice" in - y|Y ) echo "yes";sitename=${domain//./_};; - n|N ) echo "no"; + y|Y ) sitename=${domain//./_};; + n|N ) echo ""; while true; do echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ] @@ -234,5 +233,5 @@ fi # Done # ##-------## +msg " Added CMS!" bash /etc/update-motd.d/51* -msg " Added CMS!" \ No newline at end of file diff --git a/AppendModule.sh b/AppendModule.sh index b48b579..fcdf7e7 100644 --- a/AppendModule.sh +++ b/AppendModule.sh @@ -258,5 +258,5 @@ done # Done # ##-------## +msg " Added Module!" bash /etc/update-motd.d/51* -msg " Added Module!" \ No newline at end of file diff --git a/CMS/nextcloud/MotdNextCloud b/CMS/nextcloud/MotdNextCloud index 4dc9f53..42c6e18 100644 --- a/CMS/nextcloud/MotdNextCloud +++ b/CMS/nextcloud/MotdNextCloud @@ -1,5 +1,5 @@ #!/bin/sh red='\e[1;31m%s\e[0m\n' printf "\n" -printf $red "Please run nextcloud-init.sh after the first nextcloud login" +printf $red "Please run bash ~/nextcloud-init.sh after the first nextcloud login" printf "\n" \ No newline at end of file diff --git a/CMS/nextcloud/conf.sh b/CMS/nextcloud/conf.sh index 53dc706..59d4ffd 100644 --- a/CMS/nextcloud/conf.sh +++ b/CMS/nextcloud/conf.sh @@ -4,4 +4,9 @@ sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$ groupadd "$sitename" useradd -g "$sitename" "$sitename" +#Nextcloud logging location +mkdir /var/log/nextcloud +chmod 774 -R /var/log/nextcloud +ln -s /var/www/"$domain"/html/data/nextcloud.log /var/log/nextcloud/"$sitename" + systemctl reload php"$phpver"-fpm \ No newline at end of file diff --git a/CMS/nextcloud/nginx-conf.sh b/CMS/nextcloud/nginx-conf.sh index 1732b9c..68de80d 100644 --- a/CMS/nextcloud/nginx-conf.sh +++ b/CMS/nextcloud/nginx-conf.sh @@ -7,8 +7,9 @@ sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/ng if [ $sslenable = 0 ]; then sed -i -e '/fastcgi_param HTTPS/c\# fastcgi_param HTTPS' /etc/nginx/sites-available/"$sitename" fi - mkdir -p /var/www/"$domain"/html +systemctl reload nginx + #Getting Nextcloud wget -t7 http://mirror.nxdi.nl/resources/nextcloud/latest.tar.bz2 -O /tmp/nextcloud.tar.bz2 @@ -47,3 +48,4 @@ wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/ne sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/nextcloud-init.sh wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/MotdNextCloud -O /etc/update-motd.d/51-nextnotice chmod +x /etc/update-motd.d/51-nextnotice + diff --git a/installer.sh b/installer.sh index ceb1c16..f2c964d 100644 --- a/installer.sh +++ b/installer.sh @@ -239,8 +239,8 @@ while true; do done read -p "Set sitename to ${domain//./_}? (y/n)" choice case "$choice" in - y|Y ) echo "yes";sitename=${domain//./_};; - n|N ) echo "no"; + y|Y ) sitename=${domain//./_};; + n|N ) echo ""; while true; do echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ] @@ -578,5 +578,5 @@ systemctl reload sshd postfix postfix@- # Done # ##-------## +msg " Done installing!" bash /etc/update-motd.d/51* -msg " Done installing!" \ No newline at end of file