add international country names
This commit is contained in:
parent
45694306b6
commit
9b95fa13e7
49
dhl.sh
49
dhl.sh
|
@ -99,14 +99,14 @@ iso3countrycode () {
|
||||||
echo "argument missing. ($0)"
|
echo "argument missing. ($0)"
|
||||||
else
|
else
|
||||||
case "$1" in
|
case "$1" in
|
||||||
Belgien) echo "BEL";;
|
Belgien|Belgium|Belgique) echo "BEL";;
|
||||||
Deutschland) echo "DEU";;
|
Deutschland|Germany|Allemagne) echo "DEU";;
|
||||||
England) echo "GBR";;
|
England|Great\ Britain|United\ Kingdom|Scotland|Wales|North\ Ireland) echo "GBR";;
|
||||||
Luxemburg|Luxembourg) echo "LUX";;
|
Luxemburg|Luxembourg) echo "LUX";;
|
||||||
Niederlande) echo "NLD";;
|
Niederlande|Netherlands) echo "NLD";;
|
||||||
Österreich) echo "AUT";;
|
Österreich|Austria|Autriche) echo "AUT";;
|
||||||
Schweiz) echo "CHE";;
|
Schweiz|Switzerland|Suisse) echo "CHE";;
|
||||||
Ungarn) echo "HUN";;
|
Ungarn|Hungaria) echo "HUN";;
|
||||||
*) echo "unknown country: $1";exit 1;;
|
*) echo "unknown country: $1";exit 1;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -114,14 +114,14 @@ iso3countrycode () {
|
||||||
|
|
||||||
testiso3 () {
|
testiso3 () {
|
||||||
# covering data in https://doku.ccc.de/index.php?title=Attribut:Chaostreff-Country&limit=500&offset=0
|
# covering data in https://doku.ccc.de/index.php?title=Attribut:Chaostreff-Country&limit=500&offset=0
|
||||||
testcmp "BEL" "iso3countrycode" "Belgien"
|
testcmp "BEL" "iso3countrycode" "Belgien" "Belgium" "Belgique"
|
||||||
testcmp "DEU" "iso3countrycode" "Deutschland"
|
testcmp "DEU" "iso3countrycode" "Deutschland" "Germany" "Allemagne"
|
||||||
testcmp "GBR" "iso3countrycode" "England"
|
testcmp "GBR" "iso3countrycode" "England" "Great Britain" "United Kingdom" "Scotland" "Wales" "North Ireland"
|
||||||
testcmp "LUX" "iso3countrycode" "Luxembourg" "Luxemburg"
|
testcmp "LUX" "iso3countrycode" "Luxembourg" "Luxemburg"
|
||||||
testcmp "NLD" "iso3countrycode" "Niederlande"
|
testcmp "NLD" "iso3countrycode" "Niederlande" "Netherlands"
|
||||||
testcmp "AUT" "iso3countrycode" "Österreich"
|
testcmp "AUT" "iso3countrycode" "Österreich" "Austria" "Autriche"
|
||||||
testcmp "HUN" "iso3countrycode" "Ungarn"
|
testcmp "HUN" "iso3countrycode" "Ungarn" "Hungaria"
|
||||||
testcmp "CHE" "iso3countrycode" "Schweiz"
|
testcmp "CHE" "iso3countrycode" "Schweiz" "Switzerland" "Suisse"
|
||||||
testcmp "" "iso3countrycode" "Simbabwe" # should fail
|
testcmp "" "iso3countrycode" "Simbabwe" # should fail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,27 @@ testconvnl () {
|
||||||
testcmp "$tn2" "convnl" "$tn1" "$tn2" && rm "$tn2"
|
testcmp "$tn2" "convnl" "$tn1" "$tn2" && rm "$tn2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getauth () {
|
||||||
|
# Zugangsdaten für das Mediawiki aus Konfiguratonsdatei bzw. ggf.
|
||||||
|
user=""
|
||||||
|
pass=""
|
||||||
|
test -f ds.conf && {
|
||||||
|
user=$(cat ds.conf|grep -i "^user="|cut -d= -f2) #
|
||||||
|
pass=$(cat ds.conf|grep -i "^pass="|cut -d= -f2) #
|
||||||
|
} || {
|
||||||
|
which pass 2>/dev/null && {
|
||||||
|
passfile="$(cat ds.conf|grep -i "^passfile="|cut -d= -f2)" # ccc/doku-htaccess
|
||||||
|
passstore="$(cat ds.conf|grep -i "^passstore="|cut -d= -f2)" # ~/.password-store/
|
||||||
|
test -f ${passstore}${passfile} || { >&2 echo "path for password manager does not match: "${passfile}; exit 1; }
|
||||||
|
user=$(pass ${passfile} |grep -i "^login "|rev|cut -d" " -f1|rev)
|
||||||
|
pass=$(pass ${passfile} |head -1)
|
||||||
|
} || { >&2 echo "tool missing: pass (unix password manager)"; exit 1; }
|
||||||
|
}
|
||||||
|
test "$user" = "" && { >&2 echo "no auth data found."; exit 1; }
|
||||||
|
echo "${user}:${pass}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
runtests () {
|
runtests () {
|
||||||
testchklength
|
testchklength
|
||||||
teststringcrop
|
teststringcrop
|
||||||
|
|
Loading…
Reference in New Issue