added sdcard support

added a new selectable option to output data to sdcard (/sd/ folder)
pull/24/head
Zappus 2017-12-16 08:57:47 -05:00 committed by GitHub
parent e8ff1c97d5
commit 036fa7d5ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash /usr/lib/turtle/turtle_module #!/bin/bash /usr/lib/turtle/turtle_module
VERSION="1.1" VERSION="1.2"
DESCRIPTION="URL Snarf sniffs HTTP traffic" DESCRIPTION="URL Snarf sniffs HTTP traffic"
CONF=/tmp/urlsnarf.form CONF=/tmp/urlsnarf.form
@ -33,6 +33,10 @@ function start {
echo "urlsnarf -n -i br-lan" | at now echo "urlsnarf -n -i br-lan" | at now
echo urlsnarf started with pid $(pidof urlsnarf) echo urlsnarf started with pid $(pidof urlsnarf)
;; ;;
sdcard)
echo "urlsnarf -n -i br-lan > /sd/urlsnarf_$DATE.log" | at now
echo urlsnarf started with pid $(pidof urlsnarf)
;;
esac esac
else else
echo "URLSnarf not configured." echo "URLSnarf not configured."
@ -63,10 +67,11 @@ function configure {
--help-button \ --help-button \
--title "URLSnarf Configuration" \ --title "URLSnarf Configuration" \
--radiolist "\n\ --radiolist "\n\
urlsnarf outputs all requested URLs sniffed from HTTP traffic in CLF (Common Log Format, used by most web servers), suitable for offline post-processing with web log analysis tool (analog, wwwstat, etc.)...\n\nUse [Space] to select choice.\n" 16 60 3\ urlsnarf outputs all requested URLs sniffed from HTTP traffic in CLF (Common Log Format, used by most web servers), suitable for offline post-processing with web log analysis tool (analog, wwwstat, etc.)...\n\nUse [Space] to select choice.\n" 16 60 4\
1 "Save log to SSHFS if available." off\ 1 "Save log to SSHFS if available." off\
2 "Save log to /tmp/" off\ 2 "Save log to /tmp/" off\
3 "Do not save log file." on\ 3 "Do not save log file." on\
4 "Save log to /sd/" off\
2>$CONF 2>$CONF
return=$? return=$?
@ -87,6 +92,10 @@ urlsnarf outputs all requested URLs sniffed from HTTP traffic in CLF (Common Log
uci set urlsnarf.log="none" uci set urlsnarf.log="none"
uci commit urlsnarf uci commit urlsnarf
;; ;;
4)
uci set urlsnarf.log="sdcard"
uci commit urlsnarf
;;
esac esac
;; ;;
$DIALOG_CANCEL) $DIALOG_CANCEL)