Files
primuntransfer/primuntransfer.sh
2026-01-21 15:17:16 +00:00

42 lines
1.0 KiB
Bash

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 <directory> | Source Directory. Default: /home/$USER/Videos/transfer"
echo " -i <ip> | 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."