-
Notifications
You must be signed in to change notification settings - Fork 0
/
playlist.sh
125 lines (125 loc) · 17.2 KB
/
playlist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#/bin/bash
#AZUR 0.9.6
#Download Music and add to playlists
sleep 30
rm /var/azuracast/playlist.sql
rclone sync cloud: /var/azuracast/muzik/muzik_sync --create-empty-src-dirs -P --transfers=1 --checkers=1;
sleep 10
rclone sync cloud: /var/azuracast/muzik/muzik_sync --create-empty-src-dirs -P --transfers=1 --checkers=1;
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
rclone sync cloud: /var/azuracast/muzik/muzik_sync --create-empty-src-dirs -P --transfers=1 --checkers=1;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 5
#Add IP from Main or comment mysql
#mysqldump -c -u root -pAbishot999 -h 172.16.101.253 azuracast station_playlists > /var/azuracast/playlist.sql;
#mysql -u root -pAbishot999 azuracast < /var/azuracast/playlist.sql;
#Add music to playlists
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_day'), id, 0, 0 from station_media m where path like 'muzik_sync/1_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/1_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/1_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_day'), id, 0, 0 from station_media m where path like 'muzik_sync/2_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/2_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/2_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/1_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/2_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/3_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_special'), id, 0, 0 from station_media m where path like 'muzik_sync/1_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_special'), id, 0, 0 from station_media m where path like 'muzik_sync/2_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_special'), id, 0, 0 from station_media m where path like 'muzik_sync/3_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_special'))";
sleep 5
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 10
php /var/azuracast/www/util/cli.php sync:run medium;
php /var/azuracast/www/util/cli.php sync:run short;
sleep 5
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_day'), id, 0, 0 from station_media m where path like 'muzik_sync/1_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/1_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/1_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_day'), id, 0, 0 from station_media m where path like 'muzik_sync/2_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/2_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/2_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/1_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/2_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/3_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_special'), id, 0, 0 from station_media m where path like 'muzik_sync/1_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_special'), id, 0, 0 from station_media m where path like 'muzik_sync/2_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_special'), id, 0, 0 from station_media m where path like 'muzik_sync/3_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_special'))";
sleep 2
pactl set-sink-volume 0 90%
sleep 2
pactl set-sink-volume 0 80%
sleep 2
pactl set-sink-volume 0 70%
sleep 2
pactl set-sink-volume 0 60%
sleep 1
pactl set-sink-volume 0 50%
sleep 1
pactl set-sink-volume 0 40%
sleep 1
pactl set-sink-volume 0 30%
sleep 1
pactl set-sink-volume 0 20%
sleep 1
php /var/azuracast/www/util/cli.php sync:run short;
sleep 1
php /var/azuracast/www/util/cli.php azuracast:radio:restart;
sleep 2
php /var/azuracast/www/util/cli.php sync:run short;
sleep 1
pactl set-sink-volume 0 60%
sleep 1
pactl set-sink-volume 0 70%
sleep 1
pactl set-sink-volume 0 80%
sleep 1
pactl set-sink-volume 0 90%
sleep 1
pactl set-sink-volume 0 100%
rm /var/azuracast/playlist.sql
rclone sync cloud: /var/azuracast/muzik/muzik_sync --create-empty-src-dirs -P --transfers=1 --checkers=1;
sleep 20
rclone sync cloud: /var/azuracast/muzik/muzik_sync --create-empty-src-dirs -P --transfers=1 --checkers=1;
sleep 5
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_day'), id, 0, 0 from station_media m where path like 'muzik_sync/1_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/1_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/1_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_day'), id, 0, 0 from station_media m where path like 'muzik_sync/2_day/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_day'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_utro'), id, 0, 0 from station_media m where path like 'muzik_sync/2_utro/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_utro'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_vecher'), id, 0, 0 from station_media m where path like 'muzik_sync/2_vecher/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_vecher'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/1_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/2_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_reklama'), id, 0, 0 from station_media m where path like 'muzik_sync/3_reklama/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_reklama'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='1_special'), id, 0, 0 from station_media m where path like 'muzik_sync/1_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='1_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='2_special'), id, 0, 0 from station_media m where path like 'muzik_sync/2_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='2_special'))";
mysql -u root -pAbishot999 -D azuracast -e "insert into station_playlist_media(playlist_id, media_id, weight, last_played) select (select id from station_playlists where name='3_special'), id, 0, 0 from station_media m where path like 'muzik_sync/3_special/%' and not exists (select * from station_playlist_media where media_id=m.id and playlist_id=(select id from station_playlists where name='3_special'))";
sleep 5