Option to rescan icecast playlist

This commit is contained in:
Bob Mottram 2017-11-26 19:58:40 +00:00
parent e19e902b68
commit 1d6b9e7402
1 changed files with 17 additions and 3 deletions

View File

@ -53,6 +53,15 @@ icecast_variables=(MY_USERNAME
ICECAST_CODE
DEFAULT_LANGUAGE)
function icecast_rescan {
if [ -d $ICECAST_DIR ]; then
if [ -f $ICECAST_PLAYLIST_FILE ]; then
rm $ICECAST_PLAYLIST_FILE
fi
icecast_add_file_to_playlist $ICECAST_DIR
fi
}
function icecast_update_daemon {
systemctl stop icecast2
if [ -f /etc/init.d/icecast2 ]; then
@ -338,7 +347,7 @@ function configure_interactive_icecast {
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \
--title $"Icecast" \
--radiolist $"Choose an operation:" 15 70 8 \
--radiolist $"Choose an operation:" 16 70 9 \
1 $"Import stream files from directory" off \
2 $"Import stream files from USB drive" off \
3 $"Manually edit playlist" off \
@ -346,7 +355,8 @@ function configure_interactive_icecast {
5 $"Format a USB drive for stream file storage" off \
6 $"Enable login for stream visitors" off \
7 $"Change password for stream visitors" off \
8 $"Exit" on 2> $data
8 $"Re-scan playlist" off \
9 $"Exit" on 2> $data
sel=$?
case $sel in
1) break;;
@ -360,7 +370,10 @@ function configure_interactive_icecast {
5) icecast_format_drive;;
6) icecast_enable_login;;
7) icecast_change_login;;
8) break;;
8) clear
echo $'Rescanning playlist'
icecast_rescan;;
9) break;;
esac
done
}
@ -661,6 +674,7 @@ function install_icecast {
icecast_update_daemon
nginx_ensite icecast
systemctl restart nginx
icecast_rescan
start_icecast
APP_INSTALLED=1