Files
quectel-rgmii-toolkit/ipk-source/sdxpinn-mount-fix/root/usr/sbin/init-overlay-watchdog.sh
Cameron Thompson 12c8430670 Update Repo
- Updated Package:
sdxpinn-quecmanager to 0.0.3

     - Fixed issue described here: c8faf539c1

- Updated package sdxpinn-console-menu to 0.0.2

     - Added new menu: LAN Settings
          - Will let you edit the LAN settings. Only for DMZ mode or normal LAN mode not mpdn_rule. Work in Progress.

- Updated package tailscaled tailscale to 1.76.1
See tailscale's website for chnagelog

Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
2024-10-30 02:26:06 +00:00

40 lines
1.1 KiB
Bash

#!/bin/ash
# Paths to monitor and synchronize
WATCH_DIR="/etc/rc.d"
TARGET_DIR="/real_rootfs/etc/rc.d"
# Function to synchronize init scripts
synchronize_init_scripts() {
mount -o remount,rw /real_rootfs
# Copy new or updated symlinks from WATCH_DIR to TARGET_DIR
for link in "$WATCH_DIR"/*; do
if [ -L "$link" ]; then
link_name=$(basename "$link")
if [ ! -e "$TARGET_DIR/$link_name" ] || [ "$link" -nt "$TARGET_DIR/$link_name" ]; then
cp -af "$link" "$TARGET_DIR/$link_name"
fi
fi
done
# Remove symlinks in TARGET_DIR that no longer exist in WATCH_DIR
for link in "$TARGET_DIR"/*; do
if [ -L "$link" ]; then
link_name=$(basename "$link")
if [ ! -e "$WATCH_DIR/$link_name" ]; then
rm -f "$TARGET_DIR/$link_name"
fi
fi
done
mount -o remount,ro /real_rootfs
}
# Initial synchronization
synchronize_init_scripts
# Monitor WATCH_DIR for changes using inotifywait
while true; do
inotifywait -e create,delete,modify,move "$WATCH_DIR"
synchronize_init_scripts
done