mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
Compare commits
1 Commits
2b43b21e37
...
ec534d6be6
Author | SHA1 | Date | |
---|---|---|---|
|
ec534d6be6 |
|
@ -125,10 +125,6 @@ get_architecture() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
comma_delimited_list() {
|
|
||||||
echo "${1}" | tr '\n' ',' | sed 's/,/, /g; s/, $//'
|
|
||||||
}
|
|
||||||
|
|
||||||
get_online_iso() {
|
get_online_iso() {
|
||||||
get_architecture
|
get_architecture
|
||||||
printf "%b\n" "${YELLOW}Fetching available operating systems...${RC}"
|
printf "%b\n" "${YELLOW}Fetching available operating systems...${RC}"
|
||||||
|
@ -149,7 +145,7 @@ get_online_iso() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b\n" "${YELLOW}Available Operating Systems:${RC}"
|
printf "%b\n" "${YELLOW}Available Operating Systems:${RC}"
|
||||||
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.[].name')"
|
echo "${OS_JSON}" | jq -r '.[].name' | tr '\n' ' '
|
||||||
printf "\n%b" "Select an operating system: "
|
printf "\n%b" "Select an operating system: "
|
||||||
read -r OS
|
read -r OS
|
||||||
|
|
||||||
|
@ -161,7 +157,7 @@ get_online_iso() {
|
||||||
PRETTY_NAME="$(echo "${OS_JSON}" | jq -r '.pretty_name')"
|
PRETTY_NAME="$(echo "${OS_JSON}" | jq -r '.pretty_name')"
|
||||||
|
|
||||||
printf "\n%b\n" "${YELLOW}Available releases for ${PRETTY_NAME}:${RC}"
|
printf "\n%b\n" "${YELLOW}Available releases for ${PRETTY_NAME}:${RC}"
|
||||||
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].release' | sort -Vur)"
|
echo "${OS_JSON}" | jq -r '.releases[].release' | sort -Vur | tr '\n' ' '
|
||||||
printf "\n%b" "Select a release: "
|
printf "\n%b" "Select a release: "
|
||||||
read -r RELEASE
|
read -r RELEASE
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
@ -174,7 +170,7 @@ get_online_iso() {
|
||||||
|
|
||||||
if echo "${OS_JSON}" | jq -e '.releases[] | select(.edition != null) | any' >/dev/null; then
|
if echo "${OS_JSON}" | jq -e '.releases[] | select(.edition != null) | any' >/dev/null; then
|
||||||
printf "%b\n" "${YELLOW}Available editions for ${PRETTY_NAME} ${RELEASE}:${RC}"
|
printf "%b\n" "${YELLOW}Available editions for ${PRETTY_NAME} ${RELEASE}:${RC}"
|
||||||
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].edition' | sort -Vur)"
|
echo "${OS_JSON}" | jq -r '.releases[].edition' | sort -Vur | tr '\n' ' '
|
||||||
printf "\n%b" "Select an edition: "
|
printf "\n%b" "Select an edition: "
|
||||||
read -r EDITION
|
read -r EDITION
|
||||||
ENTRY="$(echo "${OS_JSON}" | jq --arg edition "${EDITION}" -c '.releases[] | select(.edition == $edition)')"
|
ENTRY="$(echo "${OS_JSON}" | jq --arg edition "${EDITION}" -c '.releases[] | select(.edition == $edition)')"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user