Compare commits
No commits in common. "7c181c84fb39f08fdc7d8a845b4ac269fc1045dd" and "e5dc67404064b660bcac2f0095e99e33c27e2fe1" have entirely different histories.
7c181c84fb
...
e5dc674040
2 changed files with 69 additions and 59 deletions
|
@ -222,6 +222,13 @@ Handle project workflows in a unified way:
|
|||
#### Shell
|
||||
|
||||
* comment
|
||||
* display locales
|
||||
* default
|
||||
* available
|
||||
* effective
|
||||
* selected
|
||||
* available
|
||||
* effective
|
||||
* handle errors
|
||||
* packages
|
||||
* configure
|
||||
|
|
|
@ -200,51 +200,62 @@ _spcd_txt_pick() {
|
|||
# ╰───────────╯
|
||||
|
||||
spcd_ca() {
|
||||
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
|
||||
local index name value
|
||||
local root="${2}"
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_CA_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
case "${1}" in
|
||||
"list")
|
||||
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
|
||||
case "${1}" in
|
||||
"list")
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_CA_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
echo "${name} ="
|
||||
echo "${value}" |
|
||||
openssl x509 -noout -text |
|
||||
grep "${grep}"
|
||||
;;
|
||||
"write")
|
||||
done
|
||||
;;
|
||||
"write")
|
||||
local root="${2}"
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_CA_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
spcd_os_write "${root}/${index}.crt" "${value}"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
}
|
||||
|
||||
spcd_dns() {
|
||||
local index name text value
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
case "${1}" in
|
||||
"list")
|
||||
local index name value
|
||||
case "${1}" in
|
||||
"list")
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
spcd_os_printenv "${name}"
|
||||
;;
|
||||
"write")
|
||||
done
|
||||
;;
|
||||
"write")
|
||||
local text
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
text="${text}\
|
||||
nameserver ${value}
|
||||
"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
if [ "${1}" = "write" ]; then
|
||||
done
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ╭───────────┬───────╮
|
||||
|
@ -378,9 +389,8 @@ spcd_txt_get() {
|
|||
}
|
||||
|
||||
spcd_txt_locale() {
|
||||
locale
|
||||
spcd_split
|
||||
local value name
|
||||
locale
|
||||
if [ -n "${1}" ]; then
|
||||
value="${1}"
|
||||
else
|
||||
|
@ -408,48 +418,41 @@ spcd_txt_locale() {
|
|||
locale
|
||||
}
|
||||
|
||||
spcd_txt_locales_echo() {
|
||||
case "${1}" in
|
||||
"LANGUAGE") spcd_os_printenv "LANGUAGE" ;;
|
||||
*) locale -a ;;
|
||||
esac
|
||||
}
|
||||
|
||||
spcd_txt_locales() {
|
||||
set -- \
|
||||
"${SPCD_TXT_LOCALE_ENGLISH}" \
|
||||
"${SPCD_TXT_LOCALE_FRENCH}"
|
||||
local language locale text
|
||||
spcd_txt_locales_echo
|
||||
spcd_split
|
||||
for locale in "${@}"; do
|
||||
case "${1}" in
|
||||
"glibc-langpack-")
|
||||
local locale
|
||||
case "${1}" in
|
||||
"glibc-langpack-")
|
||||
local language
|
||||
for locale in "${@}"; do
|
||||
language="$(echo "${locale}" | cut -d _ -f 1)"
|
||||
spcd_install_package "glibc-langpack-${language}"
|
||||
;;
|
||||
"LANGUAGE")
|
||||
done
|
||||
;;
|
||||
"LANGUAGE")
|
||||
local text
|
||||
for locale in "${@}"; do
|
||||
if [ -n "${text}" ]; then
|
||||
text="${text}:${locale}"
|
||||
else
|
||||
text="${locale}"
|
||||
fi
|
||||
;;
|
||||
"locale.gen")
|
||||
done
|
||||
export LANGUAGE="${text}"
|
||||
;;
|
||||
"locale.gen")
|
||||
local text
|
||||
for locale in "${@}"; do
|
||||
text="${text}\
|
||||
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||
"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
case "${1}" in
|
||||
"LANGUAGE") export LANGUAGE="${text}" ;;
|
||||
"locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;;
|
||||
done
|
||||
spcd_os_write "/etc/locale.gen" "${text}"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
spcd_split
|
||||
spcd_txt_locales_echo
|
||||
}
|
||||
|
||||
# ╭──────╮
|
||||
|
|
Loading…
Reference in a new issue