24 lines
400 B
Bash
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"
|