* [Bismark-commits] rev 333 - trunk/server/conf trunk/server/keys trunk/server/scripts
@ 2011-05-13 13:33 walter
0 siblings, 0 replies; only message in thread
From: walter @ 2011-05-13 13:33 UTC (permalink / raw)
To: bismark-commits
Author: walter
Date: 2011-05-13 15:33:46 +0200 (Fri, 13 May 2011)
New Revision: 333
Modified:
trunk/server/conf/bdm.conf
trunk/server/keys/authorized_keys
trunk/server/scripts/bdm
trunk/server/scripts/bdmd
trunk/server/scripts/xml_parse.py
Log:
multiport bdm daemon
ssh-key with more restrictions
revised recovery tunnel detection mechanism (alpha)
Modified: trunk/server/conf/bdm.conf
===================================================================
--- trunk/server/conf/bdm.conf 2011-05-11 16:14:27 UTC (rev 332)
+++ trunk/server/conf/bdm.conf 2011-05-13 13:33:46 UTC (rev 333)
@@ -3,6 +3,7 @@
# UDP Probing options
SERVER_ADDR=143.215.131.215
+PROBE_PORTS="1028 1234 5353 54321"
PROBE_PORT=5353
# Messaging options
Modified: trunk/server/keys/authorized_keys
===================================================================
--- trunk/server/keys/authorized_keys 2011-05-11 16:14:27 UTC (rev 332)
+++ trunk/server/keys/authorized_keys 2011-05-13 13:33:46 UTC (rev 333)
@@ -1,5 +1,5 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAlkC49G7meag6BIA4lu44nqcTTWY3rG2EB+SYc7BmbS2jEVuEwtQCZB9BSyIqqz4AkMbNaKWfUkrZjI7v4NXwGabTLuLSrW9NQ4XAhxiC5vdTj59aNrk6tjutZWmLZ4yQY7zNSNC//N1JgMeG8MeuEwg5xjGuXtZCYS9/2Oay/o/8OEM5BcJ3AE8Ypguz0c/J+5qXMm5ephPkVljYULDVVOPoKfhMqIy61rVOt8B54CmzVmMqJSwmCEqHCvUkAtg3eJcgMUOKtkURxSTgDOU8hSmPJTO4mvKpLywY6X9rwipL9zIGSkd+qI/Lqu/tbydgxT9P3Dza0DbX6fJl5RLYEQ== walter@frankie
-no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA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RQDMums3RNPhPkFH1yJ84A2FKuj+mlUdb64jz3qDORqIHbOPxtRoCWK2g7FhNWCmOTev1ziov1oNvdwxLjwh/CYsDoVqqy+hPJpFb6F43ph/9w== srikanth@galapagos
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvN/AV+iW/UXxZrbqREk/a/rERlh73JpE8tDeE3HRAngV3y0GDax5KE2cBs5cxOAt2Yd0t/wzb0litKR3oRVjQxchNnoTGfcQkpq6sOIuAPgZiY+h91hjFYs28rDbf0JzvP8WWhM54NDbnPUsMoc0DC+Jc0IQ11VQ6k8O1BwOgiM= bismark@dp4
Modified: trunk/server/scripts/bdm
===================================================================
--- trunk/server/scripts/bdm 2011-05-11 16:14:27 UTC (rev 332)
+++ trunk/server/scripts/bdm 2011-05-13 13:33:46 UTC (rev 333)
@@ -44,6 +44,8 @@
blacklist [<dev_id> <on|off>] Manage devices blacklist
+ updatetunnels Updates the tunnel list catching eventual recovery shells
+
settunnel <dev_id> <port> Set the tunnel entry for <dev_id>
setuser <dev_id> <username> Set the SSH username for <dev_id>
@@ -153,6 +155,9 @@
[ $3 ] || { echo -e "Missing parameter: <port>\n"; help settunnel; }
settunnel $2 $3
;;
+ updatetunnels)
+ updatetunnels
+ ;;
copy)
[ $2 ] || { echo -e "Missing parameter: <file>\n"; help copy; }
[ $3 ] || { echo -e "Missing parameter: <dev_id>\n"; help copy; }
@@ -334,6 +339,13 @@
sendmail $1 "Recovery tunnel created for $1 on port $2"
}
+# Update the tunnel list from ps and netstat outputs
+function updatetunnels()
+{
+ echo -n "Updating tunnels..."
+ echo done
+}
+
## User command functions ##
# Start new tunnel
Modified: trunk/server/scripts/bdmd
===================================================================
--- trunk/server/scripts/bdmd 2011-05-11 16:14:27 UTC (rev 332)
+++ trunk/server/scripts/bdmd 2011-05-13 13:33:46 UTC (rev 333)
@@ -93,24 +93,25 @@
done
shift $(( OPTIND - 1 ))
-pid=$(pgrep bdmd.real)
+pids=$(pgrep bdmd.real)
+ports=$(sudo netstat -lnup | awk -F"[\t: ]*" '/bdmd.real/{ print $5 }')
case $1 in
start)
- if [ $pid ]; then
- echo "bdmd already running"
+ if [ "$( echo $ports | awk "/$PROBE_PORT/{ print \"busy\" }")" == "busy" ]; then
+ echo "bdmd already running on port $PROBE_PORT"
else
echo -n "Starting bdmd..."
bdmd.real $PROBE_PORT >> $BDMD_LOG_FILE 2> /tmp/bdmd.debug &
sleep 1
- [ $(pgrep bdmd.real) ] && echo "done" || echo "error"
+ [ "$(pgrep bdmd.real)" ] && echo "done" || echo "error"
fi
;;
stop)
- if [ $pid ]; then
+ if [ "$pids" ]; then
echo -n "Stopping bdmd..."
- kill $(pgrep bdmd.real)
+ kill $pids
sleep 1
- [ $(pgrep bdmd.real) ] && echo "error" || echo "done"
+ [ "$(pgrep bdmd.real)" ] && echo "error" || echo "done"
else
echo "bdmd not running"
fi
@@ -120,9 +121,8 @@
$0 -l $PROBE_PORT start
;;
info)
- if [ $pid ]; then
- port=$(sudo netstat -lanup | awk -F':| *' '/'$pid'\//{ print $5 }')
- echo "bdmd listening on $port (pid $pid)"
+ if [ "$pids" ]; then
+ echo "bdmd listening on "$ports" (pids "$pids")"
else
echo "bdmd not running"
fi
Modified: trunk/server/scripts/xml_parse.py
===================================================================
--- trunk/server/scripts/xml_parse.py 2011-05-11 16:14:27 UTC (rev 332)
+++ trunk/server/scripts/xml_parse.py 2011-05-13 13:33:46 UTC (rev 333)
@@ -63,8 +63,9 @@
def get_uid(did,table):
cmd = 'SELECT userid from ' + table + ' where '
cmd += 'deviceid = "' + did + '"'
- res = sql.run_data_cmd(cmd)
- return str(res[0][0])
+ #res = sql.run_data_cmd(cmd)
+ #return str(res[0][0])
+ return "NULL"
def write_block_v1_0(data,tables,log,file):
if 'info' not in data:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-13 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 13:33 [Bismark-commits] rev 333 - trunk/server/conf trunk/server/keys trunk/server/scripts walter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox