Pārlūkot izejas kodu

Backup and restore the icecast playlist

Bob Mottram 7 gadus atpakaļ
vecāks
revīzija
945ca4180d
1 mainītis faili ar 15 papildinājumiem un 8 dzēšanām
  1. 15
    8
      src/freedombone-app-icecast

+ 15
- 8
src/freedombone-app-icecast Parādīt failu

391
     if [ ! -d $ICECAST_DIR ]; then
391
     if [ ! -d $ICECAST_DIR ]; then
392
         return
392
         return
393
     fi
393
     fi
394
-    systemctl stop icecast2
394
+    stop_icecast
395
 
395
 
396
     cp /etc/nginx/.icepasswd $ICECAST_DIR
396
     cp /etc/nginx/.icepasswd $ICECAST_DIR
397
+    cp /etc/ices2/ices-playlist.xml $ICECAST_DIR
397
 
398
 
398
     function_check backup_directory_to_usb
399
     function_check backup_directory_to_usb
399
     backup_directory_to_usb $ICECAST_DIR icecast
400
     backup_directory_to_usb $ICECAST_DIR icecast
400
 
401
 
401
     rm $ICECAST_DIR/.icepasswd
402
     rm $ICECAST_DIR/.icepasswd
402
-    systemctl start icecast2
403
+    start_icecast
403
 }
404
 }
404
 
405
 
405
 function restore_local_icecast {
406
 function restore_local_icecast {
406
     if [ ! -d $ICECAST_DIR ]; then
407
     if [ ! -d $ICECAST_DIR ]; then
407
         return
408
         return
408
     fi
409
     fi
409
-    systemctl stop icecast2
410
+    stop_icecast
410
     temp_restore_dir=/root/tempicecast
411
     temp_restore_dir=/root/tempicecast
411
     function_check restore_directory_from_usb
412
     function_check restore_directory_from_usb
412
     restore_directory_from_usb $temp_restore_dir icecast
413
     restore_directory_from_usb $temp_restore_dir icecast
417
     fi
418
     fi
418
     cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
419
     cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
419
     rm $ICECAST_DIR/.icepasswd
420
     rm $ICECAST_DIR/.icepasswd
421
+    cp $ICECAST_DIR/ices-playlist.xml /etc/ices2
422
+    rm $ICECAST_DIR/ices-playlist.xml
420
     chown -R icecast2:icecast $ICECAST_DIR
423
     chown -R icecast2:icecast $ICECAST_DIR
424
+    chown -R icecast2:icecast /etc/ices2
421
 
425
 
422
-    systemctl start icecast2
426
+    start_icecast
423
     rm -rf $temp_restore_dir
427
     rm -rf $temp_restore_dir
424
 }
428
 }
425
 
429
 
427
     if [ ! -d $ICECAST_DIR ]; then
431
     if [ ! -d $ICECAST_DIR ]; then
428
         return
432
         return
429
     fi
433
     fi
430
-    systemctl stop icecast2
434
+    stop_icecast
431
 
435
 
432
     cp /etc/nginx/.icepasswd $ICECAST_DIR
436
     cp /etc/nginx/.icepasswd $ICECAST_DIR
437
+    cp /etc/ices2/ices-playlist.xml $ICECAST_DIR
433
 
438
 
434
     function_check backup_directory_to_friend
439
     function_check backup_directory_to_friend
435
     backup_directory_to_friend $ICECAST_DIR icecast
440
     backup_directory_to_friend $ICECAST_DIR icecast
436
 
441
 
437
     rm $ICECAST_DIR/.icepasswd
442
     rm $ICECAST_DIR/.icepasswd
438
-    systemctl start icecast2
443
+    start_icecast
439
 }
444
 }
440
 
445
 
441
 function restore_remote_icecast {
446
 function restore_remote_icecast {
442
     if [ ! -d $ICECAST_DIR ]; then
447
     if [ ! -d $ICECAST_DIR ]; then
443
         return
448
         return
444
     fi
449
     fi
445
-    systemctl stop icecast2
450
+    stop_icecast
446
     temp_restore_dir=/root/tempicecast
451
     temp_restore_dir=/root/tempicecast
447
     function_check restore_directory_from_friend
452
     function_check restore_directory_from_friend
448
     restore_directory_from_friend $temp_restore_dir icecast
453
     restore_directory_from_friend $temp_restore_dir icecast
453
     fi
458
     fi
454
     cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
459
     cp $ICECAST_DIR/.icepasswd /etc/nginx/.icepasswd
455
     rm $ICECAST_DIR/.icepasswd
460
     rm $ICECAST_DIR/.icepasswd
461
+    cp $ICECAST_DIR/ices-playlist.xml /etc/ices2
462
+    rm $ICECAST_DIR/ices-playlist.xml
456
     chown -R icecast2:icecast $ICECAST_DIR
463
     chown -R icecast2:icecast $ICECAST_DIR
457
 
464
 
458
-    systemctl start icecast2
465
+    start_icecast
459
     rm -rf $temp_restore_dir
466
     rm -rf $temp_restore_dir
460
 }
467
 }
461
 
468