diff --git a/addtoken b/addtoken index 0075ca5..9505d74 120000 --- a/addtoken +++ b/addtoken @@ -1 +1 @@ -magic_run \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/createdb b/createdb index 0075ca5..9505d74 120000 --- a/createdb +++ b/createdb @@ -1 +1 @@ -magic_run \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/deletedb b/deletedb index a033324..9505d74 120000 --- a/deletedb +++ b/deletedb @@ -1 +1 @@ -addtoken \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/door/config.lua b/door/config.lua index 7d3fa65..1a27245 100644 --- a/door/config.lua +++ b/door/config.lua @@ -3,7 +3,7 @@ config = { ['db'] = "cricket", ['prefix_len'] = 4, - ['open_cmd'] = "ssh root@fe80::218:84ff:fe1d:3fbc%eth0 door", + ['open_cmd'] = "ssh root@fe80::218:84ff:fe1d:3fbc%eth0 door &", ['key_len'] = 164, -- key_len/8*6 must be an integer!!!1! ['ttl'] = 60 * 60 * 24 * 7 * 8, -- s m h d w factor Time To Life (while alive) ['ttrd'] = 60 * 60 * 24 * 365, -- s m h d y Time To Real Death (while in graveyard) diff --git a/door/door.lua b/door/door.lua index a4a9f60..50b58c5 100644 --- a/door/door.lua +++ b/door/door.lua @@ -1,7 +1,10 @@ #!/usr/bin/env lua +require 'config' +require 'helper' + function open_door() - require 'config' + kill_stdio() os.execute(config.open_cmd) end diff --git a/door/helper.lua b/door/helper.lua index f767415..d35052f 100644 --- a/door/helper.lua +++ b/door/helper.lua @@ -7,7 +7,7 @@ end function qspawn(program) -- quit spawn kill_stdio() - os.execute(program .. " &") + os.execute(program .. " &> /dev/null &") end function rows(con, stmt) diff --git a/magic_run b/door/magic_run similarity index 100% rename from magic_run rename to door/magic_run diff --git a/door/open.lua b/door/open.lua index 43eabe8..4a8e0be 100644 --- a/door/open.lua +++ b/door/open.lua @@ -49,7 +49,7 @@ else token = set_prefix(token,generate_token()) if b ~= false then add_token(con, token) - qspawn("lua door.lua") + qspawn("./openseamless") end print(token) else diff --git a/door/openseamless b/door/openseamless new file mode 100755 index 0000000..5356ec4 --- /dev/null +++ b/door/openseamless @@ -0,0 +1,8 @@ +#!/bin/sh + +exec 0>/dev/null +exec 1>/dev/null +exec 2>/dev/null + +lua door.lua & + diff --git a/listusers b/listusers index 0075ca5..9505d74 120000 --- a/listusers +++ b/listusers @@ -1 +1 @@ -magic_run \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/open b/open deleted file mode 120000 index 0075ca5..0000000 --- a/open +++ /dev/null @@ -1 +0,0 @@ -magic_run \ No newline at end of file diff --git a/revoke b/revoke index 0075ca5..9505d74 120000 --- a/revoke +++ b/revoke @@ -1 +1 @@ -magic_run \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/statistic b/statistic index 0075ca5..9505d74 120000 --- a/statistic +++ b/statistic @@ -1 +1 @@ -magic_run \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file diff --git a/www/open b/www/open index 176968e..9505d74 120000 --- a/www/open +++ b/www/open @@ -1 +1 @@ -/home/cricket/open \ No newline at end of file +/home/cricket/door/magic_run \ No newline at end of file