This commit is contained in:
oliver
2026-04-21 17:29:54 -03:00
commit 3deb54f5aa
116 changed files with 4551 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail
if [ $# -ne 2 ]; then
echo "Usage: $0 <local_file> <remote_absolute_path>"
exit 1
fi
LOCAL_FILE="$1"
REMOTE_PATH="$2"
if [ ! -f "$LOCAL_FILE" ]; then
echo "Error: Local file '$LOCAL_FILE' not found."
exit 1
fi
if [ ! -f "$hosts_file" ]; then
echo "Error: Hosts file '$hosts_file' not found."
exit 1
fi
# Push the file content using tee with doas
echo "Pushing $LOCAL_FILE to $REMOTE_PATH on all hosts in $hosts_file"
pssh -h "$hosts_file" -l "$USER" -i "doas tee \"$REMOTE_PATH\" > /dev/null" < "$LOCAL_FILE"