2012-11-07 17:59:39 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# TODO: port to node, if you really need it
|
|
|
|
|
|
|
|
REDIS_PORT=6379 # default port
|
|
|
|
|
|
|
|
|
2012-11-09 01:57:59 +08:00
|
|
|
if test -z "$2"; then
|
2012-11-07 17:59:39 +08:00
|
|
|
echo "Usage: $0 <username> <tablename>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
username="$1"
|
|
|
|
tabname="$2"
|
|
|
|
|
|
|
|
dbname=`redis-cli -p ${REDIS_PORT} -n 5 hget "rails:users:${username}" "database_name"`
|
|
|
|
redis-cli get "map_style|${dbname}|${tabname}" | sed -e 's/\\n/\n/g' -e 's/\\//g'
|