diff options
author | Rob Austein <sra@hactrn.net> | 2008-01-09 15:15:36 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-01-09 15:15:36 +0000 |
commit | df4fd57fe409c4642dd98f202c9493bab02bd856 (patch) | |
tree | 4ba13eb03d8e3fde84f00bd4ca3688d673fc59e2 /scripts | |
parent | a7b93e9f09a428c4d5d90353ddd79044e304686e (diff) |
Renaming http-client.py to cronjob.py is easier than explaining why
the name is wrong.
svn path=/scripts/Old/http-client.py; revision=1453
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Old/http-client.py (renamed from scripts/http-client.py) | 0 | ||||
-rw-r--r-- | scripts/Old/http-demo.conf | 19 | ||||
-rw-r--r-- | scripts/Old/http-server.py (renamed from scripts/http-server.py) | 0 | ||||
-rw-r--r-- | scripts/apnic-poke-1.sh | 2 | ||||
-rw-r--r-- | scripts/apnic-poke-2.sh | 2 | ||||
-rw-r--r-- | scripts/cronjob.py | 33 | ||||
-rw-r--r-- | scripts/rootd.sh | 14 |
7 files changed, 61 insertions, 9 deletions
diff --git a/scripts/http-client.py b/scripts/Old/http-client.py index 5829ac4b..5829ac4b 100644 --- a/scripts/http-client.py +++ b/scripts/Old/http-client.py diff --git a/scripts/Old/http-demo.conf b/scripts/Old/http-demo.conf new file mode 100644 index 00000000..3fbd9a91 --- /dev/null +++ b/scripts/Old/http-demo.conf @@ -0,0 +1,19 @@ +[server] +https-key = biz-certs/Carol-EE.key +https-cert.0 = biz-certs/Carol-EE.cer +https-cert.1 = biz-certs/Carol-CA.cer +https-ta = biz-certs/Dave-Root.cer + +[client] +https-key = biz-certs/Dave-EE.key +https-cert.0 = biz-certs/Dave-EE.cer +https-cert.1 = biz-certs/Dave-CA.cer +https-ta.0 = biz-certs/Alice-Root.cer +https-ta.1 = biz-certs/Bob-Root.cer +https-ta.2 = biz-certs/Carol-Root.cer +https-ta.3 = biz-certs/Elena-Root.cer +https-ta.4 = biz-certs/Frank-Root.cer +https-ta.5 = biz-certs/Ginny-Root.cer +https-ta.6 = biz-certs/Harry-Root.cer + +https-url = https://localhost:4433/cronjob diff --git a/scripts/http-server.py b/scripts/Old/http-server.py index a966f6fa..a966f6fa 100644 --- a/scripts/http-server.py +++ b/scripts/Old/http-server.py diff --git a/scripts/apnic-poke-1.sh b/scripts/apnic-poke-1.sh index f59dcc80..63685c0d 100644 --- a/scripts/apnic-poke-1.sh +++ b/scripts/apnic-poke-1.sh @@ -90,7 +90,7 @@ else trap "kill $rpkid $irdb $rootd" 0 1 2 3 13 15 fi -python http-client.py +python cronjob.py if test -z "$STY" then diff --git a/scripts/apnic-poke-2.sh b/scripts/apnic-poke-2.sh index dbeaf690..53f842a0 100644 --- a/scripts/apnic-poke-2.sh +++ b/scripts/apnic-poke-2.sh @@ -101,7 +101,7 @@ else trap "kill $rpkid $irdb" 0 1 2 3 13 15 fi -python http-client.py +python cronjob.py if test -z "$STY" then diff --git a/scripts/cronjob.py b/scripts/cronjob.py new file mode 100644 index 00000000..ca9cb652 --- /dev/null +++ b/scripts/cronjob.py @@ -0,0 +1,33 @@ +# $Id$ + +""" +Tool to trigger "cron" runs in rpkid. + +Usage: python cronjob.py [ { -c | --config } configfile ] + [ { -h | --help } ] + +Default configuration file is cronjob.conf, override with --config option. +""" + +import rpki.config, rpki.https, getopt, sys + +cfg_file = "cronjob.conf" + +opts,argv = getopt.getopt(sys.argv[1:], "c:h?", ["config=", "help"]) +for o,a in opts: + if o in ("-h", "--help", "-?"): + print __doc__ + sys.exit(0) + elif o in ("-c", "--config"): + cfg_file = a +if argv: + print __doc__ + raise RuntimeError, "Unexpected arguments %s" % argv + +cfg = rpki.config.parser(cfg_file, "cronjob") + +print rpki.https.client(privateKey = rpki.x509.RSA(Auto_file = cfg.get("https-key")), + certChain = rpki.x509.X509_chain(Auto_files = cfg.multiget("https-cert")), + x509TrustList = rpki.x509.X509_chain(Auto_files = cfg.multiget("https-ta")), + url = cfg.get("https-url"), + msg = "Please run cron now.") diff --git a/scripts/rootd.sh b/scripts/rootd.sh index 2b8fd07d..860ad0bd 100644 --- a/scripts/rootd.sh +++ b/scripts/rootd.sh @@ -83,11 +83,11 @@ then : Waiting to let daemons start up; sleep 5 - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date; time python testpoke.py -r issue - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date; time python testpoke.py -r issue @@ -99,16 +99,16 @@ then date; time python testpoke.py -r revoke date; time python testpoke.py -r list - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date; time python testpoke.py -r issue date; time python testpoke.py -r revoke date; time python testpoke.py -r list - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date; time python testpoke.py -r issue @@ -118,11 +118,11 @@ then date; time python testpoke.py -r issue date; time python testpoke.py -r revoke date; time python testpoke.py -r list - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date; time python testpoke.py -r issue - date; time python http-client.py + date; time python cronjob.py date; time python testpoke.py -r list date |