Compare commits
3 commits
f54b515115
...
7d61b7c431
Author | SHA1 | Date | |
---|---|---|---|
7d61b7c431 | |||
a0122d5ea3 | |||
095b343fde |
2 changed files with 46 additions and 65 deletions
|
@ -229,10 +229,6 @@ Handle project workflows in a unified way:
|
|||
* selected
|
||||
* available
|
||||
* effective
|
||||
* factorize
|
||||
* ca
|
||||
* dns
|
||||
* locales
|
||||
* handle errors
|
||||
* packages
|
||||
* configure
|
||||
|
|
|
@ -200,62 +200,51 @@ _spcd_txt_pick() {
|
|||
# ╰───────────╯
|
||||
|
||||
spcd_ca() {
|
||||
local index name value
|
||||
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}"
|
||||
done
|
||||
;;
|
||||
"write")
|
||||
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")
|
||||
echo "${name} ="
|
||||
echo "${value}" |
|
||||
openssl x509 -noout -text |
|
||||
grep "${grep}"
|
||||
;;
|
||||
"write")
|
||||
spcd_os_write "${root}/${index}.crt" "${value}"
|
||||
done
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
spcd_dns() {
|
||||
local index name value
|
||||
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")
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
spcd_os_printenv "${name}"
|
||||
done
|
||||
;;
|
||||
"write")
|
||||
local text
|
||||
while true; do
|
||||
index=$((index + 1))
|
||||
name="SPCD_DNS_${index}"
|
||||
eval "value=\"\${${name}}\""
|
||||
[ -n "${value}" ] || break
|
||||
text="${text}\
|
||||
nameserver ${value}
|
||||
"
|
||||
done
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
if [ "${1}" = "write" ]; then
|
||||
spcd_os_write "/etc/resolv.conf" "${text}"
|
||||
fi
|
||||
}
|
||||
|
||||
# ╭───────────┬───────╮
|
||||
|
@ -422,37 +411,33 @@ spcd_txt_locales() {
|
|||
set -- \
|
||||
"${SPCD_TXT_LOCALE_ENGLISH}" \
|
||||
"${SPCD_TXT_LOCALE_FRENCH}"
|
||||
local locale
|
||||
local language locale text
|
||||
for locale in "${@}"; do
|
||||
case "${1}" in
|
||||
"glibc-langpack-")
|
||||
local language
|
||||
for locale in "${@}"; do
|
||||
language="$(echo "${locale}" | cut -d _ -f 1)"
|
||||
spcd_install_package "glibc-langpack-${language}"
|
||||
done
|
||||
;;
|
||||
"LANGUAGE")
|
||||
local text
|
||||
for locale in "${@}"; do
|
||||
if [ -n "${text}" ]; then
|
||||
text="${text}:${locale}"
|
||||
else
|
||||
text="${locale}"
|
||||
fi
|
||||
done
|
||||
export LANGUAGE="${text}"
|
||||
;;
|
||||
"locale.gen")
|
||||
local text
|
||||
for locale in "${@}"; do
|
||||
text="${text}\
|
||||
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
|
||||
"
|
||||
done
|
||||
spcd_os_write "/etc/locale.gen" "${text}"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
case "${1}" in
|
||||
"LANGUAGE") export LANGUAGE="${text}" ;;
|
||||
"locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;;
|
||||
*) ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ╭──────╮
|
||||
|
|
Loading…
Reference in a new issue