add are you sure check in revoke
This commit is contained in:
parent
aa1102b20f
commit
2e44c19f45
|
@ -36,7 +36,7 @@ end
|
||||||
|
|
||||||
tokencount = tonumber(tokencount)
|
tokencount = tonumber(tokencount)
|
||||||
if tokencount == 0 then
|
if tokencount == 0 then
|
||||||
print "mo token found in database."
|
print "token not found in database."
|
||||||
elseif tokencount == 1 then
|
elseif tokencount == 1 then
|
||||||
print "token found. token is valid."
|
print "token found. token is valid."
|
||||||
else
|
else
|
||||||
|
|
|
@ -33,9 +33,15 @@ if 0 == con:execute("select ttl from tokens where prefix='"..prefix.."';"):numro
|
||||||
exit(env,con)
|
exit(env,con)
|
||||||
end
|
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)
|
exit(env,con)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "* try to open tronlab's moleflap"
|
echo "* try to open tronlab's moleflap"
|
||||||
|
|
||||||
HOST='moleflap'
|
HOST='moleflap.hq.c3d2.de'
|
||||||
STORE=~/.moletoken.c3d2
|
STORE=~/.moletoken.c3d2
|
||||||
|
|
||||||
if [ -e $STORE ]
|
if [ -e $STORE ]
|
||||||
|
|
Loading…
Reference in New Issue