Created
May 24, 2014 19:28
-
-
Save flyser/ed235b51474465c67648 to your computer and use it in GitHub Desktop.
My shell shortcut to start a dlna server in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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