add scripts from dmzscripts repo to scripts
This commit is contained in:
25
scripts/addsubdomain/addsub.sh
Executable file
25
scripts/addsubdomain/addsub.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
## Generate TLS certificate for a new subdomain
|
||||
|
||||
DMZKEYFILE="~/.ssh/dmz"
|
||||
|
||||
NGINXHOST=$1
|
||||
SUBDOMAIN=$2
|
||||
|
||||
if [[ -z "$NGINXHOST" ]]; then
|
||||
echo "Set Nginx Host"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$SUBDOMAIN" ]]; then
|
||||
echo "Set subdomain"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ssh-add -t 200 $DMZKEYFILE
|
||||
torsocks scp ./remotecmd $NGINXHOST:/root/remotecmd.sh
|
||||
torsocks scp ./subdomain.krov.dmz.rs $NGINXHOST:/etc/nginx/sites-available/
|
||||
torsocks scp ./subdomain.krov.dmz.rs.https $NGINXHOST:/etc/nginx/sites-available/
|
||||
|
||||
torsocks ssh $NGINXHOST "chmod +x /root/remotecmd.sh; /root/remotecmd.sh $SUBDOMAIN"
|
||||
|
Reference in New Issue
Block a user