functionlist_distros() { # It will print the distro name if any version of distro is available for current ${CPU_ARCH} # $MIRROR and $CPU_ARCH are defined at main() if [[ ${CPU_ARCH} == "" ]]; then get_cpu_arch fi export MIRROR=${MIRROR} select_mirror for i in $(curl -sL ${LXC_MIRROR}/meta/1.0/index-system | grep ${CPU_ARCH} | grep -v cloud | cut -d ";" -f 1 | uniq); do echo -e "[${CPU_ARCH}] $i" done }
functionlist_distro_version() { # If the version of the distro is available, print it # $MIRROR, $DISTRO and $CPU_ARCH are defined at main() if [[ ${DISTRO} == "" ]]; then echo -e "\033[31mOS distro not set.\033[0m" exit 1 fi if [[ ${CPU_ARCH} == "" ]]; then get_cpu_arch fi export MIRROR=${MIRROR} select_mirror if [[ $(curl -sL "${LXC_MIRROR}/meta/1.0/index-system" | grep ${DISTRO} | grep ${CPU_ARCH}) == "" ]]; then echo -e "\033[31mCould not found image for current cpu architecture.\033[0m" exit 1 fi for i in $(curl -sL "${LXC_MIRROR}/meta/1.0/index-system" | grep ${DISTRO} | grep ${CPU_ARCH} | grep -v cloud | cut -d ";" -f 1,2); do echo -e "[${CPU_ARCH}] $(echo $i | cut -d ";" -f 1) : $(echo $i | cut -d ";" -f 2)" done }