add are you sure check in revoke

This commit is contained in:
cricket 2010-03-03 05:06:38 +01:00
parent aa1102b20f
commit 2e44c19f45
3 changed files with 10 additions and 4 deletions

View File

@ -36,7 +36,7 @@ end
tokencount = tonumber(tokencount)
if tokencount == 0 then
print "mo token found in database."
print "token not found in database."
elseif tokencount == 1 then
print "token found. token is valid."
else

View File

@ -33,9 +33,15 @@ if 0 == con:execute("select ttl from tokens where prefix='"..prefix.."';"):numro
exit(env,con)
end
assert(con:execute("delete from tokens where prefix='"..prefix.."';"))
io.stdout:write("are you sure you want to delete all tokens with prefix '" .. prefix .. "': [yes|no] ")
answer = io.stdin:read()
if answer == "yes" then
assert(con:execute("delete from tokens where prefix='"..prefix.."'; delete from graveyard where prefix='"..prefix.."';"))
print "* token removed"
exit(env,con)
end
print "* token removed"
print "* action canceled"
exit(env,con)

View File

@ -1,7 +1,7 @@
#!/bin/sh
echo "* try to open tronlab's moleflap"
HOST='moleflap'
HOST='moleflap.hq.c3d2.de'
STORE=~/.moletoken.c3d2
if [ -e $STORE ]