forked from finn/tinyboard
setup-hub.sh: fix sed delimiter and add file dep, onboard-spoke.sh: fix rclone append newline guard and keyscan key-type dedup, offboard-spoke.sh: fix crontab empty check and add timestamped backup, setup-network.sh: replace single bak with timestamped backup, compose.yaml: replace syncthing host network with explicit port bindings
This commit is contained in:
@@ -21,9 +21,11 @@ services:
|
||||
container_name: spoke-syncthing
|
||||
hostname: spoke-syncthing
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
ports:
|
||||
- "127.0.0.1:8384:8384"
|
||||
- "22000:22000"
|
||||
volumes:
|
||||
- /home/armbian/st:/var/syncthing
|
||||
|
||||
@@ -124,9 +124,12 @@ fi
|
||||
header "Writing Netplan Config"
|
||||
BACKUP_FILE=""
|
||||
if [ -f "$NETPLAN_FILE" ]; then
|
||||
BACKUP_FILE="/root/$(basename "${NETPLAN_FILE}").bak"
|
||||
NETPLAN_BACKUP_DIR="/root/.config/tinyboard/netplan-backups"
|
||||
mkdir -p "$NETPLAN_BACKUP_DIR"
|
||||
BACKUP_FILE="$NETPLAN_BACKUP_DIR/$(basename "${NETPLAN_FILE}").$(date +%Y%m%d%H%M%S)"
|
||||
cp "$NETPLAN_FILE" "$BACKUP_FILE"
|
||||
info "Backup saved to $BACKUP_FILE"
|
||||
info "Netplan config backed up to $BACKUP_FILE"
|
||||
info "To restore: cp $BACKUP_FILE $NETPLAN_FILE && netplan apply"
|
||||
fi
|
||||
|
||||
if $IS_WIFI; then
|
||||
|
||||
@@ -278,7 +278,7 @@ chmod 600 "$SSH_DIR/known_hosts"
|
||||
HUB_KEYSCAN=$(ssh-keyscan -H "$HUB_HOST" 2>/dev/null)
|
||||
if [ -n "$HUB_KEYSCAN" ]; then
|
||||
while IFS= read -r KEYSCAN_LINE; do
|
||||
KEYSCAN_KEY=$(echo "$KEYSCAN_LINE" | awk '{print $3}')
|
||||
KEYSCAN_KEY=$(echo "$KEYSCAN_LINE" | awk '{print $2, $3}')
|
||||
if ! grep -qF "$KEYSCAN_KEY" "$SSH_DIR/known_hosts" 2>/dev/null; then
|
||||
echo "$KEYSCAN_LINE" >> "$SSH_DIR/known_hosts"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user