Init commit
This commit is contained in:
commit
e1fb073943
29
shallot.sh
Normal file
29
shallot.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/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
|
Reference in New Issue
Block a user