Skip to content

Commit

Permalink
Shorter example external script
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba committed Jan 16, 2016
1 parent b9d95e8 commit c733594
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions examples/external.sh
@@ -1,29 +1,13 @@
#!/bin/sh
#
# Dummy example external script that loads/saves
# account_key/key/cert/chain to /tmp/foo; Usage: `simp_le -f
# external.sh`.

load () {
cat /tmp/foo || true
}

save () {
cat - > /tmp/foo
}

persisted () {
echo account_key key cert chain
}
# account_key/key/cert/chain to /tmp/foo. Experiment e.g. by running
# `./external.sh persisted`, `echo foo | ./external.sh save; cat
# /tmp/foo`, or `./external.sh load`; note the exit codes. The plugin
# can be loaded by running `simp_le -f external.sh`.

case $1 in
save)
save
;;
load)
load
;;
persisted)
persisted
;;
save) cat - > /tmp/foo;;
load) [ ! -f /tmp/foo ] || cat /tmp/foo;;
persisted) echo account_key key cert chain;;
esac

0 comments on commit c733594

Please sign in to comment.