Compare commits

..

No commits in common. "8e50cb2e15e3ee1cd17b5c0ace28f96982b98b5a" and "c4a071178cd5667b738536fa080049c4be871456" have entirely different histories.

224
pidd.sh
View file

@ -38,19 +38,6 @@ pidd_main() {
pidd_switch_to_python "${@}" pidd_switch_to_python "${@}"
} }
# context
pidd_list_environment_variables() {
pidd_step "List environment variables"
env | sort
}
pidd_list_working_directory() {
pidd_step "List working directory"
pidd_lwd__path="$(realpath .)"
pidd_ls "${pidd_lwd__path}"
}
# steps # steps
pidd_set_environment_variables () { pidd_set_environment_variables () {
@ -72,19 +59,18 @@ pidd_set_environment_variables() {
esac esac
# set operating system version # set operating system version
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
"${PIDD_OS_ALMA}" | "${PIDD_OS_FEDORA}" | "${PIDD_OS_ROCKY}" | \ "${PIDD_OS_ALMA}"|"${PIDD_OS_ARCH}"|"${PIDD_OS_FEDORA}"|"${PIDD_OS_ROCKY}")
"${PIDD_OS_ARCH}") PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \
PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID | | sed "s|^\([0-9]\+\)\..*|\1|")
sed "s|^\([0-9]\+\)\..*|\1|")
;; ;;
"${PIDD_OS_ALPINE}") "${PIDD_OS_ALPINE}")
PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID | PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \
sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|")
;; ;;
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)"
;; ;;
*) ;; *)
esac esac
# check operating system version # check operating system version
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -124,7 +110,7 @@ pidd_set_environment_variables() {
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_OS_ID" "PIDD_OS_VERSION" pidd_echo "PIDD_OS_ID" "PIDD_OS_VERSION"
@ -155,7 +141,7 @@ pidd_set_environment_variables() {
PIDD_CA_ROOT="/usr/local/share/ca-certificates" PIDD_CA_ROOT="/usr/local/share/ca-certificates"
PIDD_CMD_CA="update-ca-certificates" PIDD_CMD_CA="update-ca-certificates"
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_CA_ROOT" "PIDD_CMD_CA" pidd_echo "PIDD_CA_ROOT" "PIDD_CMD_CA"
@ -173,7 +159,7 @@ pidd_set_environment_variables() {
"${PIDD_OS_ARCH}") "${PIDD_OS_ARCH}")
PIDD_PM="${PIDD_PM_PACMAN}" PIDD_PM="${PIDD_PM_PACMAN}"
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PM" pidd_echo "PIDD_PM"
@ -247,7 +233,7 @@ Dir::Etc::SourceParts \"\";
Acquire::https::Verify-Peer False; Acquire::https::Verify-Peer False;
" "
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PM_CLEAN" \ pidd_echo "PIDD_PM_CLEAN" \
@ -277,7 +263,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_OS_UBUNTU}") "${PIDD_OS_UBUNTU}")
PIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" PIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu"
;; ;;
*) ;; *)
esac esac
PIDD_URL_CHOSEN="${PIDD_URL_DEFAULT}" PIDD_URL_CHOSEN="${PIDD_URL_DEFAULT}"
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -291,22 +277,22 @@ Acquire::https::Verify-Peer False;
[ -n "${PIDD_URL_ARCH}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ARCH}" [ -n "${PIDD_URL_ARCH}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ARCH}"
;; ;;
"${PIDD_OS_DEBIAN}") "${PIDD_OS_DEBIAN}")
[ -n "${PIDD_URL_DEBIAN}" ] && PIDD_URL_CHOSEN="${PIDD_URL_DEBIAN}" || [ -n "${PIDD_URL_DEBIAN}" ] && PIDD_URL_CHOSEN="${PIDD_URL_DEBIAN}" \
PIDD_URL_CHOSEN="https://deb.debian.org/debian" || PIDD_URL_CHOSEN="https://deb.debian.org/debian"
;; ;;
"${PIDD_OS_FEDORA}") "${PIDD_OS_FEDORA}")
[ -n "${PIDD_URL_FEDORA}" ] && PIDD_URL_CHOSEN="${PIDD_URL_FEDORA}" || [ -n "${PIDD_URL_FEDORA}" ] && PIDD_URL_CHOSEN="${PIDD_URL_FEDORA}" \
PIDD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" || PIDD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases"
;; ;;
"${PIDD_OS_ROCKY}") "${PIDD_OS_ROCKY}")
[ -n "${PIDD_URL_ROCKY}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ROCKY}" || [ -n "${PIDD_URL_ROCKY}" ] && PIDD_URL_CHOSEN="${PIDD_URL_ROCKY}" \
PIDD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" || PIDD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir"
;; ;;
"${PIDD_OS_UBUNTU}") "${PIDD_OS_UBUNTU}")
[ -n "${PIDD_URL_UBUNTU}" ] && PIDD_URL_CHOSEN="${PIDD_URL_UBUNTU}" || [ -n "${PIDD_URL_UBUNTU}" ] && PIDD_URL_CHOSEN="${PIDD_URL_UBUNTU}" \
PIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" || PIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu"
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_URL_DEFAULT" "PIDD_URL_CHOSEN" pidd_echo "PIDD_URL_DEFAULT" "PIDD_URL_CHOSEN"
@ -328,7 +314,7 @@ Acquire::https::Verify-Peer False;
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"bookworm") PIDD_PYTHON_COMMAND="python3.11" ;; "bookworm") PIDD_PYTHON_COMMAND="python3.11" ;;
"bullseye") PIDD_PYTHON_COMMAND="python3.9" ;; "bullseye") PIDD_PYTHON_COMMAND="python3.9" ;;
*) ;; *)
esac esac
PIDD_PYTHON_PACKAGE="python3" PIDD_PYTHON_PACKAGE="python3"
;; ;;
@ -340,11 +326,11 @@ Acquire::https::Verify-Peer False;
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"noble") PIDD_PYTHON_COMMAND="python3.12" ;; "noble") PIDD_PYTHON_COMMAND="python3.12" ;;
"jammy") PIDD_PYTHON_COMMAND="python3.10" ;; "jammy") PIDD_PYTHON_COMMAND="python3.10" ;;
*) ;; *)
esac esac
PIDD_PYTHON_PACKAGE="python3" PIDD_PYTHON_PACKAGE="python3"
;; ;;
*) ;; *)
esac esac
# set python packages # set python packages
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -357,7 +343,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_ALIAS}/dist-packages" PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_ALIAS}/dist-packages"
;; ;;
*) ;; *)
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PYTHON_COMMAND" "PIDD_PYTHON_PACKAGE" "PIDD_PYTHON_PACKAGES" pidd_echo "PIDD_PYTHON_COMMAND" "PIDD_PYTHON_PACKAGE" "PIDD_PYTHON_PACKAGES"
@ -440,7 +426,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_PM_APK}"|"${PIDD_PM_APT}") PIDD_PKG_SSH="openssh-client" ;; "${PIDD_PM_APK}"|"${PIDD_PM_APT}") PIDD_PKG_SSH="openssh-client" ;;
"${PIDD_PM_DNF}") PIDD_PKG_SSH="openssh-clients" ;; "${PIDD_PM_DNF}") PIDD_PKG_SSH="openssh-clients" ;;
"${PIDD_PM_PACMAN}") PIDD_PKG_SSH="openssh" ;; "${PIDD_PM_PACMAN}") PIDD_PKG_SSH="openssh" ;;
*) ;; *)
esac esac
} }
@ -449,25 +435,27 @@ pidd_set_packages_repositories() {
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
"${PIDD_OS_ALMA}") "${PIDD_OS_ALMA}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"8") pidd_spr__file="/etc/yum.repos.d/almalinux.repo" ;; "8") \
"9") pidd_spr__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; pidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux.repo" ;;
*) ;; "9") \
pidd_set_packages_repositories__file="/etc/yum.repos.d/almalinux-baseos.repo" ;;
*)
esac esac
pidd_sed "${pidd_spr__file}" \ pidd_sed "${pidd_set_packages_repositories__file}" \
"|^mirrorlist|# mirrorlist|" \ "|^mirrorlist|# mirrorlist|" \
"|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \ "|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \
"|^# baseurl|baseurl|" "|^# baseurl|baseurl|"
;; ;;
"${PIDD_OS_ALPINE}") "${PIDD_OS_ALPINE}")
pidd_spr__file="/etc/apk/repositories" pidd_set_packages_repositories__file="/etc/apk/repositories"
pidd_write "${pidd_spr__file}" "\ pidd_write "${pidd_set_packages_repositories__file}" "\
${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/main ${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/main
${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/community ${PIDD_URL_CHOSEN}/v${PIDD_OS_VERSION}/community
" "
;; ;;
"${PIDD_OS_DEBIAN}") "${PIDD_OS_DEBIAN}")
pidd_spr__file="/etc/apt/sources.list" pidd_set_packages_repositories__file="/etc/apt/sources.list"
pidd_write "${pidd_spr__file}" "\ pidd_write "${pidd_set_packages_repositories__file}" "\
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main
@ -476,25 +464,27 @@ deb ${PIDD_URL_CHOSEN}-security ${PIDD_OS_VERSION}-security main
;; ;;
"${PIDD_OS_ROCKY}") "${PIDD_OS_ROCKY}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"8") pidd_spr__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; "8") \
"9") pidd_spr__file="/etc/yum.repos.d/rocky.repo" ;; pidd_set_packages_repositories__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;;
*) ;; "9") \
pidd_set_packages_repositories__file="/etc/yum.repos.d/rocky.repo" ;;
*)
esac esac
pidd_sed "${pidd_spr__file}" \ pidd_sed "${pidd_set_packages_repositories__file}" \
"|^mirrorlist|# mirrorlist|" \ "|^mirrorlist|# mirrorlist|" \
"|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \ "|${PIDD_URL_DEFAULT}|${PIDD_URL_CHOSEN}|" \
"|^#baseurl|baseurl|" "|^#baseurl|baseurl|"
;; ;;
"${PIDD_OS_UBUNTU}") "${PIDD_OS_UBUNTU}")
pidd_spr__file="/etc/apt/sources.list" pidd_set_packages_repositories__file="/etc/apt/sources.list"
pidd_write "${pidd_spr__file}" "\ pidd_write "${pidd_set_packages_repositories__file}" "\
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION} main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-backports main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-security main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-security main
" "
;; ;;
*) ;; *)
esac esac
} }
@ -505,12 +495,23 @@ pidd_set_packages_configuration() {
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
export DEBIAN_FRONTEND="noninteractive" export DEBIAN_FRONTEND="noninteractive"
;; ;;
*) ;; *)
esac esac
} }
# agnostic steps # agnostic steps
pidd_list_environment_variables () {
pidd_step "List environment variables"
env | sort
}
pidd_list_working_directory () {
pidd_step "List working directory"
pidd_list_working_directory__path="$(realpath .)"
pidd_ls "${pidd_list_working_directory__path}"
}
pidd_set_https_verification_off () { pidd_set_https_verification_off () {
if [ -n "${PIDD_CA}" ] || [ "${PIDD_PM}" = "${PIDD_PM_APT}" ] ; then if [ -n "${PIDD_CA}" ] || [ "${PIDD_PM}" = "${PIDD_PM_APT}" ] ; then
pidd_step "Set HTTPS verification off" pidd_step "Set HTTPS verification off"
@ -521,12 +522,12 @@ pidd_set_https_verification_off() {
pidd_set_dns_resolving () { pidd_set_dns_resolving () {
pidd_step "Set DNS resolving" pidd_step "Set DNS resolving"
for pidd_sdr__server in ${PIDD_DNS}; do for pidd_set_dns_resolving__server in ${PIDD_DNS} ; do
pidd_sdr__text="${pidd_sdr__text}\ pidd_set_dns_resolving__text="${pidd_set_dns_resolving__text}\
nameserver ${pidd_sdr__server} nameserver ${pidd_set_dns_resolving__server}
" "
done done
pidd_write "${PIDD_DNS_FILE}" "${pidd_sdr__text}" pidd_write "${PIDD_DNS_FILE}" "${pidd_set_dns_resolving__text}"
} }
pidd_update_packages_catalog () { pidd_update_packages_catalog () {
@ -547,15 +548,20 @@ pidd_install_ca_certificates() {
pidd_write_ca_certificates () { pidd_write_ca_certificates () {
pidd_step "Write CA certificates" pidd_step "Write CA certificates"
pidd_mkdir "${PIDD_CA_ROOT}" pidd_mkdir "${PIDD_CA_ROOT}"
pidd_wcc__index=1 pidd_write_ca_certificates__index=1
eval "pidd_wcc__text=\"\${PIDD_CA_${pidd_wcc__index}}\"" eval "pidd_write_ca_certificates__text=\
while [ -n "${pidd_wcc__text}" ]; do \"\${PIDD_CA_${pidd_write_ca_certificates__index}}\""
pidd_wcc__path="${PIDD_CA_ROOT}/${pidd_wcc__index}.crt" while [ -n "${pidd_write_ca_certificates__text}" ] ; do
pidd_write_ca_certificates__path="\
${PIDD_CA_ROOT}/${pidd_write_ca_certificates__index}.crt"
pidd_split pidd_split
pidd_write "${pidd_wcc__path}" "${pidd_wcc__text}" pidd_write \
pidd_openssl "${pidd_wcc__path}" "${pidd_write_ca_certificates__path}" \
pidd_wcc__index=$((pidd_wcc__index + 1)) "${pidd_write_ca_certificates__text}"
eval "pidd_wcc__text=\"\${PIDD_CA_${pidd_wcc__index}}\"" pidd_openssl "${pidd_write_ca_certificates__path}"
pidd_write_ca_certificates__index=$((pidd_write_ca_certificates__index+1))
eval "pidd_write_ca_certificates__text=\
\"\${PIDD_CA_${pidd_write_ca_certificates__index}}\""
done done
} }
@ -605,61 +611,73 @@ pidd_clean_packages_cache() {
pidd_install_python_modules () { pidd_install_python_modules () {
pidd_step "Install Python modules" pidd_step "Install Python modules"
pidd_ipm__root="$(mktemp --directory)" || exit pidd_install_python_modules__root="$(mktemp --directory)" || exit
echo "${pidd_ipm__root}" echo "${pidd_install_python_modules__root}"
for pidd_ipm__repository in "${PIDD_GIT_MAIN}" "${PIDD_GIT_ROOT}"; do for pidd_install_python_modules__repository \
case "${pidd_ipm__repository}" in in "${PIDD_GIT_MAIN}" "${PIDD_GIT_ROOT}" ; do
http*) pidd_ipm__url="${pidd_ipm__repository}" ;; case "${pidd_install_python_modules__repository}" in
/*) pidd_ipm__url="${PIDD_PROJECT_ROOT}${pidd_ipm__repository}" ;; http*) pidd_install_python_modules__url="\
*) pidd_ipm__url="\ ${pidd_install_python_modules__repository}" ;;
${PIDD_PROJECT_ROOT}/${PIDD_PROJECT_PATH}/${pidd_ipm__repository}" ;; /*) pidd_install_python_modules__url="${PIDD_PROJECT_ROOT}\
${pidd_install_python_modules__repository}" ;;
*) pidd_install_python_modules__url="${PIDD_PROJECT_ROOT}\
/${PIDD_PROJECT_PATH}/${pidd_install_python_modules__repository}" ;;
esac esac
pidd_ipm__name="$(basename "${pidd_ipm__url}")" pidd_install_python_modules__name="\
$(basename "${pidd_install_python_modules__url}")"
pidd_split pidd_split
echo "\ echo "\
${pidd_ipm__url} ${pidd_install_python_modules__url}
" "
git clone \ git clone \
"${pidd_ipm__url}" \ "${pidd_install_python_modules__url}" \
"${pidd_ipm__root}/${pidd_ipm__name}" || "${pidd_install_python_modules__root}\
exit /${pidd_install_python_modules__name}" \
pidd_ipm__path="${pidd_ipm__root}/${pidd_ipm__name}/${pidd_ipm__name}" || exit
pidd_install_python_modules__path="\
${pidd_install_python_modules__root}\
/${pidd_install_python_modules__name}\
/${pidd_install_python_modules__name}"
echo "\ echo "\
${pidd_ipm__path} ${pidd_install_python_modules__path}
${PIDD_PYTHON_PACKAGES}" ${PIDD_PYTHON_PACKAGES}"
cp --recursive "${pidd_ipm__path}" "${PIDD_PYTHON_PACKAGES}" || cp --recursive \
exit "${pidd_install_python_modules__path}" "${PIDD_PYTHON_PACKAGES}" \
|| exit
done done
pidd_split pidd_split
pidd_ls "${PIDD_PYTHON_PACKAGES}" pidd_ls "${PIDD_PYTHON_PACKAGES}"
pidd_split pidd_split
pidd_rm "${pidd_ipm__root}" pidd_rm "${pidd_install_python_modules__root}"
} }
pidd_write_python_module () { pidd_write_python_module () {
pidd_step "Write Python module" pidd_step "Write Python module"
for pidd_wpm__variable in \ for pidd_write_python_module__variable in \
OPEN DOWN VERT SPLT __UP SHUT \
OS_ID OS_VERSION \ OS_ID OS_VERSION \
PROJECT_ROOT PROJECT_PATH PROJECT_NAME \ PROJECT_ROOT PROJECT_PATH PROJECT_NAME \
OPEN DOWN VERT SPLT __UP SHUT; do ; do
pidd_wpm__value="$(pidd_echo "PIDD_${pidd_wpm__variable}")" pidd_write_python_module__value="\
pidd_wpm__text="${pidd_wpm__text}${pidd_wpm__value} $(pidd_echo "PIDD_${pidd_write_python_module__variable}")"
pidd_write_python_module__text="${pidd_write_python_module__text}\
${pidd_write_python_module__value}
" "
done done
pidd_write "${PIDD_PYTHON_PACKAGES}/env.py" "${pidd_wpm__text} pidd_write "${PIDD_PYTHON_PACKAGES}/env.py" "${pidd_write_python_module__text}\
PIDD_STEP = $((PIDD_STEP+1)) PIDD_STEP = $((PIDD_STEP+1))
" "
} }
pidd_switch_to_python () { pidd_switch_to_python () {
pidd_step "Switch to Python" pidd_step "Switch to Python"
pidd_stp__name="$(basename "${PIDD_GIT_MAIN}")" pidd_switch_to_python__name="$(basename "${PIDD_GIT_MAIN}")"
echo "\ echo "\
${PIDD_PATH} ${PIDD_PATH}
${PIDD_PYTHON_PACKAGES}/${pidd_stp__name}" ${PIDD_PYTHON_PACKAGES}/${pidd_switch_to_python__name}"
"${PIDD_PYTHON_ALIAS}" -m "${pidd_stp__name}" "${@}" "${PIDD_PYTHON_ALIAS}" -m "${pidd_switch_to_python__name}" "${@}"
} }
# functions # functions
@ -698,9 +716,9 @@ pidd_error_os() {
pidd_grep_os () { pidd_grep_os () {
pidd_grep_os__variable="${1}" pidd_grep_os__variable="${1}"
if [ -n "${pidd_grep_os__variable}" ] ; then if [ -n "${pidd_grep_os__variable}" ] ; then
grep "^${pidd_grep_os__variable}=" "/etc/os-release" | grep "^${pidd_grep_os__variable}=" "/etc/os-release" \
sed "s|^${pidd_grep_os__variable}=||" | | sed "s|^${pidd_grep_os__variable}=||" \
sed "s|^\"\(.*\)\"$|\1|" | sed "s|^\"\(.*\)\"$|\1|"
fi fi
} }
@ -715,8 +733,8 @@ pidd_ln_python() {
pidd_ln_python__command="${1}" pidd_ln_python__command="${1}"
if [ -n "${pidd_ln_python__command}" ] ; then if [ -n "${pidd_ln_python__command}" ] ; then
echo "${PIDD_PYTHON_ALIAS}${pidd_ln_python__command}" echo "${PIDD_PYTHON_ALIAS}${pidd_ln_python__command}"
ln -f -s "${pidd_ln_python__command}" "/usr/bin/${PIDD_PYTHON_ALIAS}" || ln -f -s "${pidd_ln_python__command}" "/usr/bin/${PIDD_PYTHON_ALIAS}" \
exit || exit
fi fi
} }
@ -746,8 +764,8 @@ pidd_openssl() {
if [ -f "${pidd_openssl__file}" ] ; then if [ -f "${pidd_openssl__file}" ] ; then
openssl x509 \ openssl x509 \
-in "${pidd_openssl__file}" \ -in "${pidd_openssl__file}" \
-noout -text || -noout -text \
exit || exit
fi fi
} }
@ -765,9 +783,9 @@ pidd_sed() {
if [ -f "${pidd_sed__file}" ] ; then if [ -f "${pidd_sed__file}" ] ; then
pidd_cat "${pidd_sed__file}" pidd_cat "${pidd_sed__file}"
for pidd_sed__regex in "${@}" ; do for pidd_sed__regex in "${@}" ; do
sed --in-place "s${pidd_sed__regex}g" "${pidd_sed__file}" && sed --in-place "s${pidd_sed__regex}g" "${pidd_sed__file}" \
pidd_cat "${pidd_sed__file}" || && pidd_cat "${pidd_sed__file}" \
exit || exit
done done
fi fi
} }