From 2d89fbdfd86bbf201c40edb03adc85201c2a7e06 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 10 Apr 2025 20:47:28 +0200 Subject: [PATCH] features --- setup/homelapGitSetup.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/setup/homelapGitSetup.sh b/setup/homelapGitSetup.sh index d8d7603..085f383 100755 --- a/setup/homelapGitSetup.sh +++ b/setup/homelapGitSetup.sh @@ -53,6 +53,22 @@ gitUserSetup() { chmod 600 "$HOME/.git-credentials" } +gitDirSetup() { + if ping -w2 10.255.255.1; then + local location="hl" + elif ping -w2 10.69.69.2; then + location="hc" + fi + + git init . + + git remote add "https://git.k4li.de/homelab/${location}-$(hostname).git" + + git commit -m "Initial script commit" + + git push +} + set_cronjob() { # Color setup using tput local RED=$(tput setaf 1) @@ -196,3 +212,6 @@ fi gitUserSetup set_cronjob + +[[ -d /opt/docker/ ]] && + gitDirSetup