Skip to content

Instantly share code, notes, and snippets.

@ubergesundheit
Created June 29, 2018 13:14
Show Gist options
  • Save ubergesundheit/83789d2cbd89732041f2cc6b80f4a779 to your computer and use it in GitHub Desktop.
Save ubergesundheit/83789d2cbd89732041f2cc6b80f4a779 to your computer and use it in GitHub Desktop.
Script to upload directly to iOS foobar 2000 Music folder
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
URL=${1:-}
if [[ -z "$URL" ]]; then
echo "USAGE: $0 URL TARGET-IP"
exit 1
fi
shift
FILENAME="${URL##*/}"
if [[ -z "$FILENAME" ]]; then
echo "FILENAME is empty ?!"
exit 1
fi
TARGET=${1:-}
if [[ -z "$TARGET" ]]; then
echo "USAGE: $0 URL TARGET-IP"
exit 1
fi
curl -s "${URL}" | curl -T - "ftp://${TARGET}/foobar2000%20Music%20Folder/${FILENAME}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment