#!/bin/sh # # icecast This shell script takes care of starting and stopping # the icecast multimedia streaming systen. # # config: /etc/icecast.xml # Source function library. . /etc/rc.d/init.d/functions if [ ! -d "$DIRECTORY" ]; then mkdir -p /etc/icecast2 fi cat /etc/dehydrated/certs-letsencrypt/meraklis.ddns.net/fullchain.pem /etc/dehydrated/certs-letsencrypt/meraklis.ddns.net/privkey.pem > /etc/icecast2/bundle.pem chown nobody:nogroup /etc/icecast2/* chmod 600 /etc/icecast2/* [ -x /usr/bin/icecast ] || exit 0 # See how we were called. case "$1" in start) # Start icecast. echo -n $"Starting icecast streaming daemon: " /usr/bin/icecast -c /etc/icecast.xml -b echo "" ;; stop) # Stop icecast. echo -n $"Shutting down icecast streaming daemon: " killall icecast echo "" ;; restart) $0 stop $0 start ;; *) echo $"Usage: $0 {start|stop|restart}" ;; esac