From 21aadfad3f8dfec4bea0e7e597e6ab9407628f6b Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Dec 2023 22:06:57 -0500 Subject: [PATCH] feat(bashrc): check for internet --- common/home/bash/config/bashrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/home/bash/config/bashrc b/common/home/bash/config/bashrc index ead27168..92fd9542 100644 --- a/common/home/bash/config/bashrc +++ b/common/home/bash/config/bashrc @@ -1,5 +1,6 @@ # Check git status of nix configs -( + +fetchNix() {( cd ~/.nix || exit 1 git fetch --all --quiet GIT=$(git -c color.status=always status | @@ -14,7 +15,14 @@ echo "$GIT" echo fi -) +)} + +# Check for internet +if wget -q --spider https://nixos.org; then + fetchNix +else + echo "Offline" +fi # Pokemon Sprite pokemon-colorscripts -r 1-5