mirror of
https://github.com/vvzvlad/vestasync.git
synced 2025-08-21 12:37:53 +03:00
move files
This commit is contained in:
7
files/apply_macs.service
Normal file
7
files/apply_macs.service
Normal 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
10
files/apply_macs.sh
Normal 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
9
files/pushgit.service
Normal 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
5
files/pushgit.sh
Normal 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
10
files/pushgit.timer
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Run pushgit.service daily
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
Persistent=true
|
||||
Unit=pushgit.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user