Skip to content

Commit

Permalink
Add diagnostic script to help troubleshoot issues
Browse files Browse the repository at this point in the history
  • Loading branch information
n-i-x committed Feb 17, 2013
1 parent a6bc106 commit 47e718c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions diagnose_me.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi

echo "Cleaning up after any previous runs..."
rm diagnose_me.zip diagnose_me.tcpdump diagnose_me.log nohup.out

echo "Gathering basic system information..."
uname -a > diagnose_me.log
echo >> diagnose_me.log

echo "Gathering basic network information..."
ifconfig -a >> diagnose_me.log
echo >> diagnose_me.log
netstat -rnW >> diagnose_me.log
echo >> diagnose_me.log
netstat -vnlW >> diagnose_me.log
echo >> diagnose_me.log

echo "Gathering process information..."
ps auxwww >> diagnose_me.log
echo >> diagnose_me.log
echo >> diagnose_me.log

echo "Starting network capture..."
nohup tcpdump -e -s 1514 -w diagnose_me.tcpdump &

echo "Starting pc_autobackup in debug mode..."
nohup ./pc_autobackup.py --debug --log_file=diagnose_me.log &

sleep 3
echo
echo
echo
echo "Please start AutoBackup on your camera..."
echo
read -p "Press [Enter] key once AutoBackup fails/finishes..."

echo "Shutting down pc_autobackup..."
pkill pc_autobackup.py

echo "Shutting down network capture..."
pkill tcpdump

echo "Archiving diagnostic files..."
zip -9 diagnose_me.zip diagnose_me.tcpdump diagnose_me.log nohup.out

echo "Deleting diagnostic files..."
rm diagnose_me.tcpdump diagnose_me.log nohup.out
3 changes: 2 additions & 1 deletion mediaserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

CREATE_OBJ = '"urn:schemas-upnp-org:service:ContentDirectory:1#CreateObject"'
CREATE_OBJ_DIDL = re.compile(r'<Elements>(?P<didl>.*)</Elements>')
CREATE_OBJ_RESPONSE = '''<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
CREATE_OBJ_RESPONSE = '''<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:CreateObjectResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ObjectID>%(obj_id)s</ObjectID>
Expand Down

0 comments on commit 47e718c

Please sign in to comment.