- Add repo-deploy.sh script for staging and deploying packages - Replicate _all.ipk packages to all 6 architectures automatically - Add "Refresh Indexes" button to LuCI dashboard for local deployments - Add RPCD refresh method to regenerate Packages indexes on-device - Support architectures: aarch64_cortex-a72, aarch64_cortex-a53, aarch64_generic, x86_64, mips_24kc, mipsel_24kc Usage: ./secubox-tools/repo-deploy.sh stage --clean ./secubox-tools/repo-deploy.sh deploy root@192.168.255.1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
79 lines
1.9 KiB
Bash
Executable File
79 lines
1.9 KiB
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
CONF_DIR="/srv/webradio/config"
|
|
MUSIC_DIR="/srv/webradio/music"
|
|
JINGLE_DIR="/srv/webradio/jingles"
|
|
LOG_DIR="/var/log/webradio"
|
|
PLAYLIST_FILE="/tmp/webradio_playlist.m3u"
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load webradio
|
|
config_get enabled main enabled '0'
|
|
|
|
[ "$enabled" != "1" ] && return 0
|
|
|
|
# Ensure directories exist
|
|
mkdir -p "$CONF_DIR" "$MUSIC_DIR" "$JINGLE_DIR" "$LOG_DIR"
|
|
|
|
# Generate configurations
|
|
/usr/sbin/webradioctl genconfig
|
|
|
|
# Start Icecast
|
|
if [ -f "$CONF_DIR/icecast.xml" ]; then
|
|
procd_open_instance icecast
|
|
procd_set_param command /usr/bin/icecast -c "$CONF_DIR/icecast.xml"
|
|
procd_set_param respawn
|
|
procd_set_param stderr 1
|
|
procd_set_param pidfile /var/run/icecast.pid
|
|
procd_close_instance
|
|
fi
|
|
|
|
# Wait for Icecast to start
|
|
sleep 2
|
|
|
|
# Start Ezstream if playlist enabled
|
|
local playlist_enabled
|
|
config_get playlist_enabled playlist enabled '0'
|
|
if [ "$playlist_enabled" = "1" ] && [ -f "$CONF_DIR/ezstream.xml" ]; then
|
|
/usr/sbin/webradioctl playlist generate
|
|
procd_open_instance ezstream
|
|
procd_set_param command /usr/bin/ezstream -c "$CONF_DIR/ezstream.xml"
|
|
procd_set_param respawn
|
|
procd_set_param stderr 1
|
|
procd_set_param pidfile /var/run/ezstream.pid
|
|
procd_close_instance
|
|
fi
|
|
|
|
# Start DarkIce if live enabled
|
|
local live_enabled
|
|
config_get live_enabled live enabled '0'
|
|
if [ "$live_enabled" = "1" ] && [ -f "$CONF_DIR/darkice.cfg" ]; then
|
|
procd_open_instance darkice
|
|
procd_set_param command /usr/bin/darkice -c "$CONF_DIR/darkice.cfg"
|
|
procd_set_param respawn
|
|
procd_set_param stderr 1
|
|
procd_set_param pidfile /var/run/darkice.pid
|
|
procd_close_instance
|
|
fi
|
|
|
|
logger -t webradio "WebRadio started"
|
|
}
|
|
|
|
stop_service() {
|
|
logger -t webradio "WebRadio stopped"
|
|
}
|
|
|
|
reload_service() {
|
|
/usr/sbin/webradioctl genconfig
|
|
/usr/sbin/webradioctl playlist generate
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "webradio"
|
|
}
|