[init:] initial commit
This commit is contained in:
41
primuntransfer.sh
Normal file
41
primuntransfer.sh
Normal file
@@ -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 <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."
|
||||
Reference in New Issue
Block a user