support ip address as new argument in addsub.sh

This commit is contained in:
2024-01-27 22:37:26 +01:00
parent 935cfc0979
commit 9cc158336b
3 changed files with 42 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ DMZKEYFILE=$(echo -n ~)"/.ssh/dmz"
NGINXHOST=$1
SUBDOMAIN=$2
CTIPADDRESS=$3
if [[ -z "$NGINXHOST" ]]; then
echo "Set Nginx Host"
@@ -16,10 +17,15 @@ if [[ -z "$SUBDOMAIN" ]]; then
exit 1
fi
ssh-add -t 200 $DMZKEYFILE
torsocks scp ./remotecmd $NGINXHOST:/root/remotecmd.sh
torsocks scp ./subdomain.dmz.rs.http $NGINXHOST:/etc/nginx/sites-available/
torsocks scp ./subdomain.dmz.rs.https $NGINXHOST:/etc/nginx/sites-available/
if [[ -z "$CTIPADDRESS" ]]; then
torsocks scp ./subdomain.dmz.rs.proxy $NGINXHOST:/etc/nginx/sites-available/
fi
torsocks ssh $NGINXHOST "chmod +x /root/remotecmd.sh; /root/remotecmd.sh $SUBDOMAIN"