dmzconf/scripts/onionadd/remotecmd

24 lines
400 B
Plaintext
Raw Normal View History

2024-02-13 02:08:27 +00:00
#!/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"