diff options
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 |