diff options
| author | onefang | 2019-11-12 02:37:11 +1000 |
|---|---|---|
| committer | onefang | 2019-11-12 02:37:11 +1000 |
| commit | c5025375de2d902bb613c78033c604105b7dc612 (patch) | |
| tree | efd6b591a018d9aa469c0b8571754f824dd03c95 /apt-panopticon.lua | |
| parent | Oops, wrong quote mark. (diff) | |
| download | apt-panopticon-c5025375de2d902bb613c78033c604105b7dc612.zip apt-panopticon-c5025375de2d902bb613c78033c604105b7dc612.tar.gz apt-panopticon-c5025375de2d902bb613c78033c604105b7dc612.tar.bz2 apt-panopticon-c5025375de2d902bb613c78033c604105b7dc612.tar.xz | |
Move the execute function to near the checkExes function.
Diffstat (limited to 'apt-panopticon.lua')
| -rwxr-xr-x | apt-panopticon.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 40c308d..227bec1 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
| @@ -201,6 +201,11 @@ local testing = function(t, host) | |||
| 201 | return false | 201 | return false |
| 202 | end | 202 | end |
| 203 | 203 | ||
| 204 | local execute = function (s) | ||
| 205 | D(" executing " .. s) | ||
| 206 | return os.execute(s) | ||
| 207 | end | ||
| 208 | |||
| 204 | local checkExes = function (exe) | 209 | local checkExes = function (exe) |
| 205 | local count = io.popen('ps x | grep "' .. exe .. '" | grep -v " grep " | wc -l'):read("*l") | 210 | local count = io.popen('ps x | grep "' .. exe .. '" | grep -v " grep " | wc -l'):read("*l") |
| 206 | D(count .. " " .. exe .. " commands still running.") | 211 | D(count .. " " .. exe .. " commands still running.") |
| @@ -369,11 +374,6 @@ local checkFiles = function (host, ip, path, file) | |||
| 369 | end | 374 | end |
| 370 | end | 375 | end |
| 371 | 376 | ||
| 372 | local execute = function (s) | ||
| 373 | D(" executing " .. s) | ||
| 374 | os.execute(s) | ||
| 375 | end | ||
| 376 | |||
| 377 | checkHost = function (orig, host, path, ip, file) | 377 | checkHost = function (orig, host, path, ip, file) |
| 378 | if nil == host then host = orig end | 378 | if nil == host then host = orig end |
| 379 | if nil == path then path = "" end | 379 | if nil == path then path = "" end |
