#!/bin/bash # Auto-refresh cookies from /tmp/share if they exist and are newer SHARE_COOKIES="/tmp/share/youtube-cookies.txt" LOCAL_COOKIES="/home/debian/videotomp3transcriptor/youtube-cookies.txt" if [ -f "$SHARE_COOKIES" ]; then # Copy if share is newer or local doesn't exist if [ ! -f "$LOCAL_COOKIES" ] || [ "$SHARE_COOKIES" -nt "$LOCAL_COOKIES" ]; then cp "$SHARE_COOKIES" "$LOCAL_COOKIES" chmod 600 "$LOCAL_COOKIES" echo "[$(date)] ✓ Cookies refreshed from /tmp/share" fi fi