move files

This commit is contained in:
vvzvlad
2023-04-16 14:09:29 +07:00
parent e35f42aa4e
commit a1d7623c10
6 changed files with 5 additions and 5 deletions

7
files/apply_macs.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=Apply MAC addresses to network interfaces
[Service]
Type=oneshot
ExecStart=/usr/local/bin/apply_macs.sh
[Install]
WantedBy=multi-user.target

10
files/apply_macs.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
macs_dir="/mnt/data/etc/vestasync/macs"
for mac_file in "$macs_dir"/*; do
ifname=$(basename "$mac_file")
if [ -f "$mac_file" ]; then
mac_address=$(cat "$mac_file")
ip link set "$ifname" address "$mac_address"
fi
done

9
files/pushgit.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Push git changes daily
[Service]
Type=oneshot
ExecStart=/mnt/data/etc/pushgit.sh
[Install]
WantedBy=multi-user.target

5
files/pushgit.sh Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
cd /mnt/data/etc/ > /dev/null 2>&1 || true
git add . > /dev/null 2>&1 || true
git commit -m "$(date)" > /dev/null 2>&1 || true
git push -u origin master > /dev/null 2>&1 || true

10
files/pushgit.timer Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Run pushgit.service daily
[Timer]
OnCalendar=daily
Persistent=true
Unit=pushgit.service
[Install]
WantedBy=timers.target