This repository has been archived on 2024-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
shallot/shallot.sh

30 lines
560 B
Bash
Raw Normal View History

2023-01-03 21:25:00 +01:00
#!/bin/bash
set -xe
echo "Shallot scritp v0.0.1"
if [[ $# -eq 0 ]] ; then
echo "No arguments was passed, exiting..."
exit 1
fi
if [[ $# -ge 2 ]] ; then
echo "Too much argument was passed, expecting to only get 1 argument, exiting..."
exit 1
fi
ONIONSITE=$1
echo "Checking if Tor Browser proxy is running..."
NETSTAT_OUTPUT=`netstat -lnp 2> /dev/null`
IF_TOR_RUNNING=`echo $NETSTAT_OUTPUT | grep -zqv "tor" && echo 0 || echo 1`
if [ "$IF_TOR_RUNNING" ] ; then
echo "Tor is running, exiting..."
exit 0;
else
echo "Tor is not running"
exit 1;
fi