Improve formatting and add internet check

pull/8/head
IMcPwn 2015-10-04 13:20:25 -04:00
parent fbb0181f9c
commit cc3f65609d
1 changed files with 221 additions and 210 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash /usr/lib/turtle/turtle_module
VERSION="2.2"
VERSION="2.3"
DESCRIPTION="Responder - LLMNR, NBT-NS and MDNS poisoner"
CONF=/tmp/responder.form
AUTHOR=IMcPwn
@ -37,18 +37,21 @@ function start {
if [[ ! $(opkg list-installed | grep git) ]];
then
check_internet
echo "Git not installed. Installing..."
opkg update && opkg install git
fi
if [[ ! $(opkg list-installed | grep python-sqlite3) ]];
then
check_internet
echo "Python-sqlite3 not installed. Installing..."
opkg update && opkg install python-sqlite3
fi
if [[ ! -d /etc/turtle/Responder || ! -s /etc/turtle/Responder/Responder.py || ! -s /etc/turtle/Responder/Responder.conf ]];
then
check_internet
rm -rf /etc/turtle/Responder
echo "Responder not downloaded or corrupted. Downloading..."
git clone git://github.com/SpiderLabs/Responder /etc/turtle/Responder
@ -189,6 +192,14 @@ function status {
if ps | grep -w -q [/]etc/turtle/Responder/Responder.py; then echo "1"; else echo "0"; fi
}
function check_internet {
ping -q -w 5 -c 1 lanturtle.com &> /dev/null && {
:
} || {
echo -e "The LAN Turtle is currently offline. Responder requires\nan internet connection to install dependencies."
exit 1
}
}
function log {
dialog --ok-label "Submit" \