From 68da4046dd3cbe1c3cccf4daa4a862594a01e80e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 26 Jul 2014 21:10:44 -0400 Subject: Add the FunnyQuestion configuration generator --- .gitignore | 1 + FunnyQuestion.conf.php.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 FunnyQuestion.conf.php.sh diff --git a/.gitignore b/.gitignore index ee5a252e..44541365 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ images/*.* images/cache cache/html/* .error.log +FunnyQuestion.conf.php 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 %s?' + +{ + echo ' 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 -- cgit v1.2.2