Files
Alcea 85d22f38f0 Add files via upload
Uptime monitor for m7350 tplink to run from it locally
2026-01-10 17:47:56 +01:00

99 lines
2.4 KiB
Bash

#!/bin/sh
# Configuration
LOCAL_DIR="/media/card/ext/sh/2025-08-04-UptimeCheck"
# Server 1
SERVER1="ftp.alcea-wisteria.de"
USER1="username@alcea-wisteria.de"
PASS1="" # ADD PASSWORD HERE
DIR1="PHP/0demo/2025-08-04-UptimeCheck"
# Server 2 - NOTE: double dot, check if correct!
SERVER2="ftp.alceawis.de"
USER2="username@alceawis.de"
PASS2="" # ADD PASSWORD HERE
DIR2="alceawis.de/other/extra/fetchdata/2025-08-04-UptimeCheck"
# Files to upload
FILES="alceawis.com.json alceawis.de.json alcea-wisteria.de.json"
echo "=== Starting FTP Upload ==="
echo ""
# Check if we have ftpput
if ! busybox | grep -q ftpput; then
echo "ERROR: ftpput not available in BusyBox!"
exit 1
fi
# Upload to Server 1
if [ -n "$PASS1" ] && [ -n "$SERVER1" ]; then
echo "=== Uploading to Server 1: $SERVER1 ==="
for file in $FILES; do
local_file="$LOCAL_DIR/$file"
if [ ! -f "$local_file" ]; then
echo " Skipping $file: Not found"
continue
fi
echo " Uploading $file..."
# Use BusyBox ftpput
busybox ftpput \
-u "$USER1" \
-p "$PASS1" \
"$SERVER1" \
"$DIR1/$file" \
"$local_file"
if [ $? -eq 0 ]; then
echo " Successfully uploaded to alcea-wisteria.de: $file"
else
echo " Failed to upload: $file"
fi
echo ""
done
else
echo "=== Skipping Server 1: No password configured ==="
fi
echo ""
# Upload to Server 2
if [ -n "$PASS2" ] && [ -n "$SERVER2" ] && [ "$SERVER2" != "ftp..xyz.de" ]; then
echo "=== Uploading to Server 2: $SERVER2 ==="
for file in $FILES; do
local_file="$LOCAL_DIR/$file"
if [ ! -f "$local_file" ]; then
echo " Skipping $file: Not found"
continue
fi
echo " Uploading $file..."
# Use BusyBox ftpput
busybox ftpput \
-u "$USER2" \
-p "$PASS2" \
"$SERVER2" \
"$DIR2/$file" \
"$local_file"
if [ $? -eq 0 ]; then
echo " Successfully uploaded to alceawis.de: $file"
else
echo " Failed to upload: $file"
fi
echo ""
done
else
echo "=== Skipping Server 2: No password or invalid host ==="
fi
echo "=== Upload completed ==="