Fixes in sh
This commit is contained in:
parent
9153ed905f
commit
8c212c647a
1 changed files with 14 additions and 14 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
# Función para mostrar mensajes de error y salir
|
# Función para mostrar mensajes de error y salir
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo -e "${RED}Error: $1${NC}" >&2
|
echo "${RED}Error: $1${NC}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,10 +43,10 @@ NETWORK_DHCP_RANGE="10.0.0.2-10.0.0.254"
|
||||||
NETWORK_DHCP_STATIC="10.0.0.1"
|
NETWORK_DHCP_STATIC="10.0.0.1"
|
||||||
TRUST_PASSWORD="" # Déjalo vacío para no configurar contraseña
|
TRUST_PASSWORD="" # Déjalo vacío para no configurar contraseña
|
||||||
|
|
||||||
echo -e "${YELLOW}Inicializando Incus con la siguiente configuración:${NC}"
|
echo "${YELLOW}Inicializando Incus con la siguiente configuración:${NC}"
|
||||||
echo " - Pool de almacenamiento: $STORAGE_POOL ($STORAGE_DRIVER)"
|
echo " - Pool de almacenamiento: $STORAGE_POOL ($STORAGE_DRIVER)"
|
||||||
echo " - Red: $NETWORK_NAME ($NETWORK_TYPE, $NETWORK_ADDR)"
|
echo " - Red: $NETWORK_NAME ($NETWORK_TYPE, $NETWORK_ADDR)"
|
||||||
echo -e "${YELLOW}Esto configurará Incus con valores por defecto.${NC}"
|
echo "${YELLOW}Esto configurará Incus con valores por defecto.${NC}"
|
||||||
|
|
||||||
# Confirmar antes de continuar
|
# Confirmar antes de continuar
|
||||||
#read -p "¿Deseas continuar? (y/N) " -n 1 -r
|
#read -p "¿Deseas continuar? (y/N) " -n 1 -r
|
||||||
|
|
@ -57,7 +57,7 @@ echo -e "${YELLOW}Esto configurará Incus con valores por defecto.${NC}"
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
# Ejecutar incus admin init con las configuraciones
|
# Ejecutar incus admin init con las configuraciones
|
||||||
echo -e "${YELLOW}Inicializando Incus...${NC}"
|
echo "${YELLOW}Inicializando Incus...${NC}"
|
||||||
|
|
||||||
cat <<EOF | incus admin init --minimal
|
cat <<EOF | incus admin init --minimal
|
||||||
config:
|
config:
|
||||||
|
|
@ -88,8 +88,8 @@ EOF
|
||||||
|
|
||||||
# Verificar si la inicialización fue exitosa
|
# Verificar si la inicialización fue exitosa
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "${GREEN}¡Incus se ha inicializado correctamente!${NC}"
|
echo "${GREEN}¡Incus se ha inicializado correctamente!${NC}"
|
||||||
echo -e "Puedes ver la información con: ${YELLOW}incus info${NC}"
|
echo "Puedes ver la información con: ${YELLOW}incus info${NC}"
|
||||||
else
|
else
|
||||||
die "Hubo un problema al inicializar Incus"
|
die "Hubo un problema al inicializar Incus"
|
||||||
fi
|
fi
|
||||||
|
|
@ -113,6 +113,14 @@ incus config device add ollama-container gpu gpu
|
||||||
|
|
||||||
# Install nvidia
|
# Install nvidia
|
||||||
|
|
||||||
|
run_command "incus exec ollama-container -- apt install -y software-properties-common gpg wget" "Add software properties package and other utilities"
|
||||||
|
|
||||||
|
run_command "incus exec ollama-container -- apt-add-repository -y contrib" "Add contrib"
|
||||||
|
|
||||||
|
run_command "incus exec ollama-container -- apt-add-repository -y non-free" "Add non-free"
|
||||||
|
|
||||||
|
run_command "incus exec ollama-container -- apt-add-repository -y non-free-firmware" "Add non-free-firmware"
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- bash -c 'echo \"deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware\" > /etc/apt/sources.list.d/backports.list'" "Añadir repo backport"
|
run_command "incus exec ollama-container -- bash -c 'echo \"deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware\" > /etc/apt/sources.list.d/backports.list'" "Añadir repo backport"
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint" "Añadir gpg incus"
|
run_command "incus exec ollama-container -- curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint" "Añadir gpg incus"
|
||||||
|
|
@ -132,14 +140,6 @@ Signed-By: /etc/apt/keyrings/zabbly.asc \
|
||||||
\
|
\
|
||||||
EOF'" "Add incus stable repo"
|
EOF'" "Add incus stable repo"
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- apt install -y software-properties-common gpg wget" "Add software properties package and other utilities"
|
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- apt-add-repository -y contrib" "Add contrib"
|
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- apt-add-repository -y non-free" "Add non-free"
|
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- apt-add-repository -y non-free-firmware" "Add non-free-firmware"
|
|
||||||
|
|
||||||
run_command "incus exec ollama-container -- apt-get update && sudo apt-get upgrade" "Upgrade repos..."
|
run_command "incus exec ollama-container -- apt-get update && sudo apt-get upgrade" "Upgrade repos..."
|
||||||
|
|
||||||
# Install new kernel.
|
# Install new kernel.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue