summaryrefslogtreecommitdiff
path: root/FunnyQuestion.conf.php.sh
blob: d280e3de7eaadd65168bb3d832ec693014bcf4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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