21 lines
626 B
Bash
21 lines
626 B
Bash
|
#!/bin/bash -e
|
||
|
|
||
|
export hostname=${HOSTNAME:=localhost}
|
||
|
export port=${PORT:=8000}
|
||
|
export max_listeners=${MAX_LISTENERS:=30}
|
||
|
export admin_user=${ADMIN_USER:=admin}
|
||
|
export admin_password=${ADMIN_PASSWORD:=admin}
|
||
|
|
||
|
pass_gen="python3 -c 'import secrets, string; print(\"\".join((secrets.choice(string.ascii_letters + string.digits) for i in range(20))))'"
|
||
|
|
||
|
export source_username=$(eval $pass_gen)
|
||
|
export source_password=$(eval $pass_gen)
|
||
|
|
||
|
pip install youtube-dl
|
||
|
|
||
|
j2 ices.xml.jinja > ices.xml
|
||
|
j2 icecast.xml.jinja > icecast.xml
|
||
|
|
||
|
runuser -l zambla -c 'icecast2 -c /config/icecast.xml &'
|
||
|
runuser -l zambla -c 'ices2 /config/ices.xml'
|