This commit is contained in:
pika 2025-04-10 20:47:28 +02:00
parent d1f135c7b6
commit 2d89fbdfd8

View file

@ -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