mirror of
https://github.com/mistergibson/radio.git
synced 2026-09-09 06:19:52 -07:00
cleanup
This commit is contained in:
parent
30aeaa4b21
commit
cc76d6e9c2
2 changed files with 18 additions and 7 deletions
|
|
@ -3,7 +3,8 @@
|
||||||
# install_for_jruby.sh - Installs the JRuby-based radio automation stack.
|
# install_for_jruby.sh - Installs the JRuby-based radio automation stack.
|
||||||
# Same layout as the Python installer but invokes jruby for the scripts.
|
# Same layout as the Python installer but invokes jruby for the scripts.
|
||||||
# Derives its service name from the containing directory, prompts for a
|
# Derives its service name from the containing directory, prompts for a
|
||||||
# storage path, writes config.json, creates the systemd unit and cron jobs.
|
# storage path and Icecast host/port/mount/credentials, writes config.json,
|
||||||
|
# creates the systemd unit and cron jobs.
|
||||||
#
|
#
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
@ -28,8 +29,10 @@ mkdir -p "${STORAGE_PATH}"/{music,podcasts,jingles,announcements,state,playlists
|
||||||
chown -R liquidsoap:liquidsoap "${STORAGE_PATH}" 2>/dev/null || true
|
chown -R liquidsoap:liquidsoap "${STORAGE_PATH}" 2>/dev/null || true
|
||||||
|
|
||||||
# --- Collect Icecast credentials ------------------------------------------
|
# --- Collect Icecast credentials ------------------------------------------
|
||||||
read -rp "Icecast source port [8000]: " IC_PORT
|
read -rp "Icecast host [127.0.0.1]: " IC_HOST
|
||||||
IC_PORT="${IC_PORT:-8000}"
|
IC_HOST="${IC_HOST:-127.0.0.1}"
|
||||||
|
read -rp "Icecast source port [7777]: " IC_PORT
|
||||||
|
IC_PORT="${IC_PORT:-7777}"
|
||||||
read -rp "Icecast mount [/radio.mp3]: " IC_MOUNT
|
read -rp "Icecast mount [/radio.mp3]: " IC_MOUNT
|
||||||
IC_MOUNT="${IC_MOUNT:-/radio.mp3}"
|
IC_MOUNT="${IC_MOUNT:-/radio.mp3}"
|
||||||
read -rp "Icecast source username [sourceadmin]: " IC_USER
|
read -rp "Icecast source username [sourceadmin]: " IC_USER
|
||||||
|
|
@ -43,8 +46,12 @@ case "${GPODDER_ENABLE,,}" in
|
||||||
y|yes)
|
y|yes)
|
||||||
read -rp "gPodder host [https://gpodder.net]: " GP_HOST
|
read -rp "gPodder host [https://gpodder.net]: " GP_HOST
|
||||||
GP_HOST="${GP_HOST:-https://gpodder.net}"
|
GP_HOST="${GP_HOST:-https://gpodder.net}"
|
||||||
|
# Strip trailing slash if the user typed one
|
||||||
|
GP_HOST="${GP_HOST%/}"
|
||||||
read -rp "gPodder username: " GP_USER
|
read -rp "gPodder username: " GP_USER
|
||||||
|
GP_USER="${GP_USER:?gPodder username required}"
|
||||||
read -rsp "gPodder password: " GP_PASS; echo
|
read -rsp "gPodder password: " GP_PASS; echo
|
||||||
|
GP_PASS="${GP_PASS:?gPodder password required}"
|
||||||
GP_JSON=$(jq -n --arg h "$GP_HOST" --arg u "$GP_USER" --arg p "$GP_PASS" \
|
GP_JSON=$(jq -n --arg h "$GP_HOST" --arg u "$GP_USER" --arg p "$GP_PASS" \
|
||||||
'{enable:true, host:$h, username:$u, password:$p}')
|
'{enable:true, host:$h, username:$u, password:$p}')
|
||||||
;;
|
;;
|
||||||
|
|
@ -58,7 +65,7 @@ cat > "$CONFIG_FILE" <<EOF
|
||||||
{
|
{
|
||||||
"storage": "${STORAGE_PATH}",
|
"storage": "${STORAGE_PATH}",
|
||||||
"icecast": {
|
"icecast": {
|
||||||
"host": "127.0.0.1",
|
"host": "${IC_HOST}",
|
||||||
"port": ${IC_PORT},
|
"port": ${IC_PORT},
|
||||||
"mount": "${IC_MOUNT}",
|
"mount": "${IC_MOUNT}",
|
||||||
"username": "${IC_USER}",
|
"username": "${IC_USER}",
|
||||||
|
|
@ -110,4 +117,6 @@ echo " $CRON_PLAYLISTS"
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Installation complete ==="
|
echo "=== Installation complete ==="
|
||||||
echo "Storage root: ${STORAGE_PATH}"
|
echo "Storage root: ${STORAGE_PATH}"
|
||||||
|
echo "JRuby: ${JRuby_BIN}"
|
||||||
echo "Start with: systemctl start ${SERVICE_NAME}"
|
echo "Start with: systemctl start ${SERVICE_NAME}"
|
||||||
|
echo "Test fetcher: ${JRuby_BIN} fetch_podcasts.rb --list-shows"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ mkdir -p "${STORAGE_PATH}"/{music,podcasts,jingles,announcements,state,playlists
|
||||||
chown -R liquidsoap:liquidsoap "${STORAGE_PATH}" 2>/dev/null || true
|
chown -R liquidsoap:liquidsoap "${STORAGE_PATH}" 2>/dev/null || true
|
||||||
|
|
||||||
# --- Collect Icecast credentials ------------------------------------------
|
# --- Collect Icecast credentials ------------------------------------------
|
||||||
|
read -rp "Icecast host [127.0.0.1]: " IC_HOST
|
||||||
|
IC_HOST="${IC_HOST:-127.0.0.1}"
|
||||||
read -rp "Icecast source port [7777]: " IC_PORT
|
read -rp "Icecast source port [7777]: " IC_PORT
|
||||||
IC_PORT="${IC_PORT:-7777}"
|
IC_PORT="${IC_PORT:-7777}"
|
||||||
read -rp "Icecast mount [/radio.mp3]: " IC_MOUNT
|
read -rp "Icecast mount [/radio.mp3]: " IC_MOUNT
|
||||||
|
|
@ -62,7 +64,7 @@ cat > "$CONFIG_FILE" <<EOF
|
||||||
{
|
{
|
||||||
"storage": "${STORAGE_PATH}",
|
"storage": "${STORAGE_PATH}",
|
||||||
"icecast": {
|
"icecast": {
|
||||||
"host": "127.0.0.1",
|
"host": "${IC_HOST}",
|
||||||
"port": ${IC_PORT},
|
"port": ${IC_PORT},
|
||||||
"mount": "${IC_MOUNT}",
|
"mount": "${IC_MOUNT}",
|
||||||
"username": "${IC_USER}",
|
"username": "${IC_USER}",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue