#!/bin/bash ARGS="$@" while [[ -n "$@" ]]; do if [[ "${1:0:1}" != "-" ]]; then if [[ -z "$volumepipe" ]]; then volumepipe="$1" elif [[ -z "$commandpipe" ]]; then commandpipe="$1" fi fi shift; done # volumepipe if ! [[ -p "$volumepipe" ]]; then rm -rf "$volumepipe" mkfifo "$volumepipe" fi # volumecontrol if [[ -p "$commandpipe" ]]; then $(echo "q" > $commandpipe)& quit_proc=$! sleep 1 kill $quit_proc rm "$commandpipe" else rm -f "$commandpipe" fi mkfifo "$commandpipe" $(sleep 1; echo "refresh" > $commandpipe)& eval set -- "$ARGS" exec "$(dirname "${BASH_SOURCE[0]}")/daemon.py" "$@"