You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. // require_once( $WDIR . '/inst_lib.php');
  3. echo "\n\n\nAFTER!!\n\n\n";
  4. $DBHost="localhost";
  5. $DBName="argus";
  6. $DBUser="argus";
  7. $DBPassword="Jc8zYWEhqGAGGYJRum92tm";
  8. run_command( 'cp -f /srv/etc/ag_nginx/argus_nginx.service /etc/systemd/system/argus_nginx.service');
  9. run_command( 'cp -f /srv/etc/argus_shutdown.service /etc/systemd/system/argus_shutdown.service');
  10. run_command( 'systemctl enable argus_nginx');
  11. run_command( 'systemctl enable argus_shutdown');
  12. run_command( 'systemctl daemon-reload');
  13. run_command( 'cp -f /srv/etc/nginx/default /etc/nginx/sites-available/default');
  14. run_command( 'cp -f /srv/etc/rc.local /etc/rc.local');
  15. run_command( 'md /srv/data/composed_videos');
  16. run_command( 'chown -R www-data:www-data /srv/data');
  17. run_command( 'chown -R www-data:www-data /srv/etc');
  18. run_command( 'chown -R www-data:www-data /srv/data/composed_videos');
  19. run_command( 'chmod -R 0775 /srv/data');
  20. run_command( 'ln -s /srv/data /srv/serva/data');
  21. run_command( 'ln -s /srv/data /srv/www/server/lib/controller/data');
  22. //Run Database Upgrade
  23. run_command( 'cd /srv/www/server/lib; php ./upgrade_database.php');
  24. // Check Folders
  25. if( !file_exists( '/srv/data/composed_videos' ) ){
  26. mkdir( '/srv/data/composed_videos' );
  27. chown( '/srv/data/composed_videos', "www-data" );
  28. chgrp( '/srv/data/composed_videos', "www-data" );
  29. chmod( '/srv/data/composed_videos', 0775 );
  30. } else {
  31. chown( '/srv/data/composed_videos', "www-data" );
  32. chgrp( '/srv/data/composed_videos', "www-data" );
  33. chmod( '/srv/data/composed_videos', 0775 );
  34. };
  35. //Restore Settings
  36. function restore_whole_line( $A, $B , $C ){
  37. $POPIN = array();
  38. foreach( $C as $Key=>$Value ){
  39. if( $Key != 'id' ){
  40. $POPIN[]="`".$Key."`='".$Value."'";
  41. };
  42. };
  43. $QS = "UPDATE `{$B}` SET ". implode(",",$POPIN)." WHERE `id`=" . $C['id'];
  44. out_log( $QS );
  45. $A->Query( $QS );
  46. };
  47. function restore_line( $A, $B , $C ){
  48. foreach( $C as $Key=>$Value ){
  49. if( $Key != 'id' ){
  50. $P="`".$Key."`='".$Value."'";
  51. $QS = "UPDATE `{$B}` SET ".$P." WHERE `id`=" . $C['id'];
  52. out_log( $QS );
  53. $A->Query( $QS );
  54. };
  55. };
  56. };
  57. run_command( 'systemctl start argus_nginx');
  58. //run_command( 'systemctl enable argus_nginx');
  59. //run_command( 'systemctl enable argus_shutdown');
  60. run_command( 'systemctl start nginx');
  61. ?>