Added init sctipt removal feature

This commit is contained in:
2020-09-03 13:18:14 +02:00
parent 59bc06569b
commit 14d066a6f9
7 changed files with 49 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/sh
red='\e[1;31m%s\e[0m\n'
printf "\n"
printf $red "Please run bash ~/nextcloud-init.sh after the first nextcloud login"
printf $red "Please run bash ~/NextcloudInit-SITEname.sh after the first nextcloud login"
printf "\n"

View File

@@ -39,9 +39,10 @@ EOF
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
#Makeing nextcloud Finalize script and setting login Notice
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/nextcloud-init.sh
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/nextcloud-init.sh
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/NextcloudInit-"$sitename".sh
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/NextcloudInit-"$sitename".sh
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/MotdNextCloud -O /etc/update-motd.d/51-nextnotice
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice
chmod +x /etc/update-motd.d/51-nextnotice

View File

@@ -17,4 +17,17 @@ else
fi
echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab
rm -f /etc/update-motd.d/51-nextnotice
rm -f /etc/update-motd.d/51-nextnotice
#Remove script
while true; do
read -p "Remove this script -> yes/no?" yn
case $yn in
[Nn]* )
break;;
[Yy]* )
rm -- "$0"
break;;
* )echo "Choose yes or no.";;
esac
done

View File

@@ -1,5 +1,5 @@
#!/bin/sh
red='\e[1;31m%s\e[0m\n'
printf "\n"
printf $red "Please run bash ~/wordpress-init.sh after the first wordpress login"
printf $red "Please run bash ~/WordpressInit-SITEname.sh after the first wordpress login"
printf "\n"

View File

@@ -48,7 +48,8 @@ fi
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
#Makeing wordpress Finalize script and setting login Notice
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/wordpress-init.sh
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/wordpress-init.sh
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/WordpressInit-"$sitename".sh
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/WordpressInit-"$sitename".sh
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/MotdWordpress -O /etc/update-motd.d/51-wpnotice
sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice
chmod +x /etc/update-motd.d/51-wpnotice

View File

@@ -4,4 +4,17 @@ sudo -u SITEname wp --path=/var/www/DOMAINname/html theme update --all
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install wp-fail2ban --activate
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install all-in-one-wp-migration --activate
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install https://git.ictmaatwerk.com/downloads/wp/migrate.zip --activate
rm -f /etc/update-motd.d/51-wpnotice
rm -f /etc/update-motd.d/51-wpnotice
#Remove script
while true; do
read -p "Remove this script -> yes/no?" yn
case $yn in
[Nn]* )
break;;
[Yy]* )
rm -- "$0"
break;;
* )echo "Choose yes or no.";;
esac
done