mirror of
https://github.com/tschettervictor/bsd-apps.git
synced 2025-12-11 09:30:00 +01:00
35 lines
997 B
Bash
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 "---------------"
|