ajustements
This commit is contained in:
parent
5002c62bee
commit
b0f63a8ff3
25
install.sh
25
install.sh
|
@ -105,6 +105,29 @@ echo -e "${BLUE}Installing GNU Guix...${NC}"
|
||||||
|
|
||||||
herd start cow-store /mnt
|
herd start cow-store /mnt
|
||||||
|
|
||||||
guix system init config.scm /mnt && reboot
|
install_guix() {
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
guix system init config.scm /mnt >(tee "$tmpfile") 2>&1
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
output=$(tail -n 3 "$tmpfile")
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
|
||||||
|
if [[ $exit_code -ne 0 && $output == *"died unexpectedly"* ]]; then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
max_retries=5
|
||||||
|
attempt=0
|
||||||
|
|
||||||
|
until install_guix; do
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
if [[ $attempt -ge $max_retries ]]; then
|
||||||
echo -e "${RED}Installation has failed${NC}"
|
echo -e "${RED}Installation has failed${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo -e "${BLUE}Trying installing GNU Guix again...${NC}"
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue