diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-26 21:10:44 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-26 21:10:44 -0400 |
commit | 68da4046dd3cbe1c3cccf4daa4a862594a01e80e (patch) | |
tree | 4a9a77f2e8e3fd7bef051d7db4e2e2624ed41384 /FunnyQuestion.conf.php.sh | |
parent | c2bfd4b6e3ef8436c5963ace9435b4c0555f047f (diff) |
Add the FunnyQuestion configuration generator
Diffstat (limited to 'FunnyQuestion.conf.php.sh')
-rw-r--r-- | FunnyQuestion.conf.php.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/FunnyQuestion.conf.php.sh b/FunnyQuestion.conf.php.sh new file mode 100644 index 00000000..66549381 --- /dev/null +++ b/FunnyQuestion.conf.php.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cmd="date -u +%V\`uname\`|sha256sum|sed 's/\W//g'" +answer="$(eval "$cmd")" + +declare -A prompts +prompts[en]='What is the output of the command <tt>%s</tt>?' + +{ + echo '<?php' + echo -n '$wgFunnyQuestions = array(' + + nl='\n' + for lang in "${!prompts[@]}"; do + printf "${nl}\t\"${lang}\" => array(\"${prompts[$lang]}\" => \"%s\")" "$cmd" "$answer" + nl=',\n' + done + + echo + echo ');' +} > /srv/http/wiki/FunnyQuestion.conf.php + +touch /srv/http/wiki/extensions/FunnyQuestion/FunnyQuestion.i18n.php |