Files
bsd-apps/icecast/icecast-install.sh
2025-04-23 20:34:36 -06:00

35 lines
997 B
Bash

#!/bin/sh
# Install Icecast
# Check for Root Privileges
if ! [ $(id -u) = 0 ]; then
echo "This script must be run with root privileges"
exit 1
fi
# Install Packages
pkg install -y \
icecast
# Create Directories
mkdir -p /usr/local/etc/icecast
mkdir -p /var/log/icecast
# Icecast Setup
if [ ! -f /usr/local/etc/icecast/icecast.xml ]; then
cp /usr/local/etc/icecast.xml.sample /usr/local/etc/icecast/icecast.xml
fi
# Enable and Start Services
sysrc icecast_config="/usr/local/etc/icecast/icecast.xml"
sysrc icecast_enable="YES"
# Done
echo "---------------"
echo "Installation Complete!"
echo "---------------"
echo "Icecast will not run as root. Change the user to "www" or some other user at the end of the icecast.xml file."
echo "Don't forget to uncomment the "changeowner" section, and change the owner of "/var/log/icecast" to the user that icecast will run as."
echo "Once you have completed the above steps, start icecast with 'service icecast start'."
echo "---------------"