The tutorial at the bottom integrates the script into the right click menu of Openbox.
Video tutorial / in action: Here
1. In the terminal enter sudo apt-get -y install dsniff --no-install-recommends
2. Enter nano ~/script.sh
3. Paste this in
LanInt="eth0" function BlockConnection { if [ -n "$(pidof tcpkill)" ]; then killall tcpkill >/dev/null 2>/dev/null; fi #Stop #Option Menu if [ -z "$(pidof tcpkill)" ]; then clear; echo; echo echo " Block Website/Webpage or IP Address" echo echo " (1) IP (2) Website (3) Cancel" echo read -p " > " BlockCheck if [[ "$BlockCheck" == "1" ]]; then clear; echo; echo; echo; read -p " IP Address: " BlockSite #IP elif [[ "$BlockCheck" == "2" ]]; then clear; echo; echo; echo; read -p " Website/Webpage: " BlockSite #Website/Webpage elif [[ "$BlockCheck" == "3" ]]; then MainMenu else BlockConnection; fi #IP if [[ "$BlockCheck" == "1" ]]; then clear; tcpkill -i $LanInt -9 host "$BlockSite"; fi #WebSite/Webpage if [[ "$BlockCheck" == "2" ]]; then if [[ "$BlockSite" == *"www."* ]]; then BlockSite="$BlockSite"; else BlockSite="www.$BlockSite"; fi #Add www. (If needed) clear; tcpkill -i $LanInt -9 host "$BlockSite"; fi fi } BlockConnection
4. Save the script
5. Lastly type sudo chmod +x script.sh
6. Open a terminal and enter:
sudo sh ~/script.sh
Using Openbox's menu to execute the script
1. In the terminal type in obmenu
2. Enter a name for the label. This is what show up when you right click. I used Bock Connection.
3. Add this to Execute at the bottom
terminator --command="sudo sh ~/script.sh"
Replace ~/script.sh to the location and file name of your choice
4. Click Save at the top. Right click on the desktop, then select Block Connection to launch the script
No comments:
Post a Comment