Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- domain="$1" && test -z ${domain} && exit 2
- read -sp "DB user password:" dbrootp
- read -sp "DB user password:" dbuserp
- wp core download --path=${drt}/${domain}/ --allow-root
- wp config create --path=${drt}/${domain}/ --dbname=${domain} --dbuser=${domain} --dbpass=${dbuserp} --dbhost="localhost" --allow-root
- sed "s/${domain}/${1}/g" "~/${repo}/template_nginx_app" > "${s_a}/${domain}.conf"
- ln -sf ${s_a}/${domain}.conf ${s_e}
- cat <<-DBSTACK | mysql -u root -p"${dbrootp}"
- CREATE USER "${domain}"@"localhost" IDENTIFIED BY "${dbuserp}";
- CREATE DATABASE ${domain};
- GRANT ALL PRIVILEGES ON ${domain}.* TO "${domain}"@"localhost";
- DBSTACK
- ${rse}
- certbot --nginx -d ${domain} -d www.${domain}
- ${rse}
- #!/bin/bash
- domain="$1" && test -z ${domain} && exit 2
- read -sp "DB user password:" dbrootp
- rm -rf ${drt}/${domain}/
- rm ${s_a}/${domain}.conf ${s_e}/${domain}.conf
- cat <<-DBSTACK | mysql -u root -p"${dbrootp}"
- DROP USER IF EXISTS "${domain}"@"localhost";
- DROP database IF EXISTS ${domain};
- DBSTACK
- rm -rf /etc/letsencrypt/{live,renewal,archive}/{${DOMAIN},${DOMAIN}.conf}
- ${rse}
- server {
- listen 80 default_server;
- listen [::]:80 default_server;
- root /var/www/html;
- index index.php index.html index.htm index.nginx-debian.html;
- server_name _;
- location / {try_files $uri $uri/ =404;}
- location ~ .php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/run/php/php7.0-fpm.sock;
- }
- }
Add Comment
Please, Sign In to add comment