summaryrefslogtreecommitdiffstats
path: root/Reaktor
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-07-17 13:15:35 +0200
committermakefu <root@pigstarter.de>2014-07-17 13:15:35 +0200
commit7fc73600e5ddf6a5f79688a2d3491cf108b0db71 (patch)
tree739c6ee23b57e1a0b6b886f1b6f398c8d92a0e98 /Reaktor
parentacb6dc257d3b6e51c30bdfc650a7631cbfc68430 (diff)
Reaktor:nag can be explicitly be called
Diffstat (limited to 'Reaktor')
-rwxr-xr-xReaktor/IRC/reaktor.py3
-rwxr-xr-xReaktor/commands/nag5
-rw-r--r--Reaktor/config.py12
3 files changed, 14 insertions, 6 deletions
diff --git a/Reaktor/IRC/reaktor.py b/Reaktor/IRC/reaktor.py
index 799fe555..124fa017 100755
--- a/Reaktor/IRC/reaktor.py
+++ b/Reaktor/IRC/reaktor.py
@@ -93,7 +93,8 @@ class Reaktor(asybot):
start = time()
try:
- print(myargv)
+ log.debug("Running : %s"%str(myargv))
+ log.debug("Environ : %s"%(str(env)))
p = popen(myargv, bufsize=1, stdout=PIPE, stderr=PIPE, env=env, cwd=cwd)
except Exception as error:
self.ME(target, 'brain damaged')
diff --git a/Reaktor/commands/nag b/Reaktor/commands/nag
index 24414dd3..e552e11c 100755
--- a/Reaktor/commands/nag
+++ b/Reaktor/commands/nag
@@ -1,6 +1,5 @@
#! /bin/sh
set -euf
-
if test -e nag.hosts.ls; then
echo "nag seems to run already... if not, then delete $workdir/nag.*, please"
exit 23
@@ -46,3 +45,7 @@ fi
if test -n "$obsolete_services"; then
echo obsolete services: $obsolete_services
fi
+# if asked directly, answer if there is nothing to nag about
+if test -z "$missing_services$obsolete_services" -a -n "${_from:-}";then
+ echo "nothing to nag about"
+fi
diff --git a/Reaktor/config.py b/Reaktor/config.py
index 0483d46b..9feecbaf 100644
--- a/Reaktor/config.py
+++ b/Reaktor/config.py
@@ -58,6 +58,13 @@ public_commands = [
default_command('tell', cmd='tell-on_privmsg', env={
'state_file': workdir + '/tell.txt'
}),
+ default_command('nag',env={
+ 'hosts_repo': 'https://github.com/krebscode/hosts',
+ 'services_repo': 'gitolite@localhost:services'
+ }),
+ simple_command('identify', env={
+ 'config_filename': config_filename
+ }),
# command not found
{ 'pattern': '^' + me_or_us + ':.*',
'argv': [ 'commands/respond','You are made of stupid!'] },
@@ -65,9 +72,6 @@ public_commands = [
{ 'pattern': '.*' + me + '.*',
'argv': [ 'commands/say', 'I\'m famous' ] },
# identify via direct connect
- simple_command('identify', env={
- 'config_filename': config_filename
- })
]
commands = [
default_command('reload'),
@@ -87,7 +91,7 @@ on_ping = [
'argv': [ 'commands/nag' ],
'env': {
'hosts_repo': 'https://github.com/krebscode/hosts',
- 'services_repo': '/home/tv/krebs/services'
+ 'services_repo': 'gitolite@localhost:services'
},
'targets': irc_channels
}