From 4cf49975ca5334af3edda562378748c9cb372ef0 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Wed, 21 Jan 2026 15:17:16 +0000 Subject: [PATCH] [init:] initial commit --- primuntransfer.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 primuntransfer.sh diff --git a/primuntransfer.sh b/primuntransfer.sh new file mode 100644 index 0000000..64238f8 --- /dev/null +++ b/primuntransfer.sh @@ -0,0 +1,41 @@ +echo "Welcome to PRIMUN-Transfer, the ultimate transfer-tool for media files." +echo "(c)2026 - MyPapertown, MyPaperCloud, Elias Fierke" +echo "Version 1.0 Transid" +echo "" + +show_help(){ + echo "-- HELP --" + echo " -d | Source Directory. Default: /home/$USER/Videos/transfer" + echo " -i | Destination-IP." + exit 0 +} + +while getopts ":d:i:h" opt; do + case $opt in + d) DIR="$OPTARG" ;; + h) show_help ;; + i) IP="$OPTARG" ;; + \?) echo "Unknown option: -$OPTARG" >&2; exit 1 ;; + :) echo "Option -$OPTARG needs an argument" >&2; exit 1 ;; + esac +done + +if [[ -z "$DIR" ]]; then + echo "No Path provided. Using /home/$USER/Videos/transfer" + DIR="/home/$USER/Videos/transfer" +fi + +if [[ -z "$IP" ]]; then + echo "No destination IP. Enter one." + read -p "Destination-IP: " IP +fi + +if [[ -z "$IP" ]]; then + echo "Still no destination IP. Bye." >&2 + exit 1 +fi + +rsync -aP --partial --progress --append-verify $DIR transfer@$IP:/mnt/videopool/$USER + +echo "" +echo "Finished. Please check for rsync-Errors yourself."