#!/bin/bash DI_CFG_PATH=/data/darkice DI_SAVE_PATH=/data/darkice LUG=$(cat ${DI_CFG_PATH}/darkice.lug) PID=$(cat ${DI_CFG_PATH}/darkice.pid) DATE=$(date +%Y%m%d%H%M) echo "/tmp/${LUG}-${DATE}.ogg" > /tmp/darkice.file-0.$PID kill -s SIGUSR1 $PID sleep 2 mv /tmp/${LUG}-${DATE}.ogg ${DI_SAVE_PATH}/${LUG}-${DATE}.ogg &> /dev/null if [[ $? -eq "0" ]]; then echo "${DI_SAVE_PATH}/${LUG}-${DATE}.ogg successfully saved" fi if [[ -n $1 ]]; then # attempt to change the owner of the file if provided chown ${1}. ${DI_SAVE_PATH}/${LUG}-${DATE}.ogg else echo "As its recommended to run this application as root, the file: ${DI_SAVE_PATH}/${LUG}-${DATE}.ogg might be have owner/group privileges of root. Feel free to change this..." fi