This commit is contained in:
2025-06-28 01:00:28 +00:00
committed by rasmus
parent efc2598160
commit de36d70e68

View File

@@ -8,8 +8,7 @@ data:
set -e set -e
mkdir -p /root/.ssh mkdir -p /root/.ssh
cp /config/ssh_identity /root/.ssh/id_ecdsa cp /config/ssh_identity /root/.ssh/id_ecdsa
chmod 600 /root/.ssh/id_ed25519 chmod 600 /root/.ssh/id_ecdsa
sleep 100
if [ -d rosdump ]; then if [ -d rosdump ]; then
echo "Pulling Git repo" echo "Pulling Git repo"
cd rosdump cd rosdump
@@ -19,13 +18,15 @@ data:
git clone git@git.k-space.ee:k-space/rosdump.git git clone git@git.k-space.ee:k-space/rosdump.git
cd rosdump cd rosdump
fi fi
git config user.name rosdumo
git config user.email rosdump@k-space.ee
git rm *.k-space.ee git rm *.k-space.ee
for target in $(cat /config/targets | grep -v '^#'); do for target in $(cat /config/targets | grep -v '^#'); do
echo "Exporting configuration for $target" echo "Exporting configuration for $target"
ssh rosdump@$target '/export' | grep -v '^# serial number =' | grep -v '^#.* by RouterOS' > $target ssh rosdump@$target '/export' | grep -v '^# serial number =' | grep -v '^#.* by RouterOS' > $target
git add $target git add $target
done done
if [[ `git status --porcelain` ]]; then if git status --porcelain; then
echo "Attempting Git check in" echo "Attempting Git check in"
git commit -m "$(git diff --cached --shortstat)" git commit -m "$(git diff --cached --shortstat)"
git push git push