Skip to content

Instantly share code, notes, and snippets.

@flyser
Created May 24, 2014 19:28
Show Gist options
  • Save flyser/ed235b51474465c67648 to your computer and use it in GitHub Desktop.
Save flyser/ed235b51474465c67648 to your computer and use it in GitHub Desktop.
My shell shortcut to start a dlna server in the current directory
function dlna {
DIR="$(pwd)"
if [[ "$1" != "" ]]; then
DIR="$(realpath "$1")"
fi
echo "Serving '$DIR'"
sed -i "s#.*media_dir.*=.*#media_dir=${DIR}#" ~/.minidlna.conf || return 1
/usr/sbin/minidlnad -d -v -R -f ~/.minidlna.conf -P /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment