Skip to content

Instantly share code, notes, and snippets.

@jlhg
Created December 2, 2014 07:08
Show Gist options
  • Save jlhg/4099ce2dddfe9a5d9880 to your computer and use it in GitHub Desktop.
Save jlhg/4099ce2dddfe9a5d9880 to your computer and use it in GitHub Desktop.
Parse arguments
# Parse arguments.
while [ $# -ge 1 ]; do
case $1 in
--help)
usage
;;
--home=?*)
MADSONIC_HOME=${1#--home=}
;;
--host=?*)
MADSONIC_HOST=${1#--host=}
;;
--port=?*)
MADSONIC_PORT=${1#--port=}
;;
--https-port=?*)
MADSONIC_HTTPS_PORT=${1#--https-port=}
;;
--context-path=?*)
MADSONIC_CONTEXT_PATH=${1#--context-path=}
;;
--init-memory=?*)
MADSONIC_INIT_MEMORY=${1#--init-memory=}
;;
--max-memory=?*)
MADSONIC_MAX_MEMORY=${1#--max-memory=}
;;
--pidfile=?*)
MADSONIC_PIDFILE=${1#--pidfile=}
;;
--quiet)
quiet=1
;;
--default-music-folder=?*)
MADSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
;;
--default-upload-folder=?*)
MADSONIC_DEFAULT_UPLOAD_FOLDER=${1#--default-upload-folder=}
;;
--default-podcast-folder=?*)
MADSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
;;
--default-playlist-import-folder=?*)
MADSONIC_DEFAULT_PLAYLIST_IMPORT_FOLDER=${1#--default-playlist-import-folder=}
;;
--default-playlist-export-folder=?*)
MADSONIC_DEFAULT_PLAYLIST_EXPORT_FOLDER=${1#--default-playlist-export-folder=}
;;
--default-playlist-backup-folder=?*)
MADSONIC_DEFAULT_PLAYLIST_BACKUP_FOLDER=${1#--default-playlist-backup-folder=}
;;
--timezone=?*)
MADSONIC_DEFAULT_TIMEZONE=${1#--timezone=}
;;
*)
usage
;;
esac
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment