Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/whipper-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# whipper-docker.sh

## Requirements
* whipper
* docker

## Deployment
1. Copy whipper-docker.sh to accessible location. In a directory where the path is defined is optimal.
2. Make whipper-docker executable. ie. chmod +x whipper-docker.sh
3. If default configuration meet your need then you are done, else create a configuration file.

## Configuration
First, the script reads the default configuration. Then, the whipper-docker.sh script looks for system settings in /etc/whipper-docker.conf. Finally, whipper-docker looks for it's configuration file in the ${HOME}/.config/whipper-docker.conf file. The last defined variable definition wins.

### Configuration Parameters

#### CD_DEVICE
Defines the location of CD device file. Defaults to the /dev/cdrom device file.

#### OUTPUT_DIR
Defiles the root directory where ripped music will be placed. Defaults to the ${HOME}/Music directory.

#### PERSONAL_CONF_DIR
This variable defines where your whipper configuration will be saved outside of the docker image. It defaults to the ${HOME}/.config/whipper directory.




40 changes: 40 additions & 0 deletions scripts/whipper-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh
CD_DEVICE="/dev/cdrom"
OUTPUT_DIR="${HOME}/Music"

PERSONAL_CONF_DIR="${HOME}/.config/whipper"
WHIPPER_DOCKER_SYSTEM_CONFIG_FILE="/etc/whipper-docker.conf"
WHIPPER_DOCKER_PERSONAL_CONFIG_FILE="${HOME}/.config/whipper-docker.conf"

if [ -e "${WHIPPER_DOCKER_SYSTEM_CONFIG_FILE}" ] ; then
. "${WHIPPER_DOCKER_SYSTEM_CONFIG_FILE}"
fi

if [ -e "${WHIPPER_DOCKER_PERSONAL_CONFIG_FILE}" ] ; then
. "${WHIPPER_DOCKER_PERSONAL_CONFIG_FILE}"
fi

if [ ! -e "${CD_DEVICE}" ] ; then
echo "Could not file CD device: ${CD_DEVICE}" 1>&2
exit 2
fi

if [ ! -d "${OUTPUT_DIR}" ] ; then
echo "Cannot access ${OUTPUT_DIR}" 1>&2
exit 2
fi


if [ ! -d "${PERSONAL_CONF_DIR}" ] ; then
echo "Creating ${PERSONAL_CONF_DIR} directory"
if ! mkdir -p "${PERSONAL_CONF_DIR}" ; then
echo "Failed to create ${PERSONAL_CONF_DIR}" 1>&2
exit 2
fi
fi

docker run -ti --rm \
--device="${CD_DEVICE}" \
-v "${PERSONAL_CONF_DIR}":/home/worker/.config/whipper \
-v "${OUTPUT_DIR}":/home/worker/output \
whipperteam/whipper "${@}"