From c3efa82ef6011a49cf228a5697e165d03a7745af Mon Sep 17 00:00:00 2001 From: Demian Date: Sun, 29 Mar 2026 17:29:18 +0200 Subject: [PATCH] added update.sh script to upload new posts to nginx --- update.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..82e6bdc --- /dev/null +++ b/update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Variables +SOURCE_DIR="./public" +DEST_USER="demian" # replace with your SSH username +DEST_HOST="pyte.dev" +DEST_DIR="/opt/docker/website/" +SSH_KEY="/home/demian/.ssh/id_ed25519-privat" # replace with your private key path if different + +# Copy folder using scp with SSH key +scp -i "$SSH_KEY" -r "$SOURCE_DIR" "$DEST_USER@$DEST_HOST:$DEST_DIR" + +# Optional: print status +if [ $? -eq 0 ]; then + echo "Folder '$SOURCE_DIR' successfully copied to $DEST_HOST:$DEST_DIR" +else + echo "Error copying folder. Check your SSH key and connection." +fi