dmzconf/scripts/onionadd/remotecmd
2024-02-13 03:08:27 +01:00

24 lines
400 B
Bash

#!/bin/bash
CTHOST=$1
CTIP=$2
if [[ -z "$CTHOST" ]]; then
echo "Set CT hostname"
exit 1
fi
if [[ -z "$CTIP" ]]; then
echo "Set CT IP"
exit 1
fi
echo "" >> /etc/tor/onions/dmz
echo "HiddenServiceDir /var/lib/tor/"$CTHOST"/" >> /etc/tor/onions/dmz
echo "HiddenServicePort 22 "$CTIP":22" >> /etc/tor/onions/dmz
service tor reload
sleep 30
cat "/var/lib/tor/"$CTHOST"/hostname"