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