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.

56 lines
1.9 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/web/lib/controller/data');
  22. //Run Database Upgrade
  23. run_command( 'cd /srv/www/web/lib; php ./upgrade_database.php');
  24. //Restore Settings
  25. function restore_whole_line( $A, $B , $C ){
  26. $POPIN = array();
  27. foreach( $C as $Key=>$Value ){
  28. if( $Key != 'id' ){
  29. $POPIN[]="`".$Key."`='".$Value."'";
  30. };
  31. };
  32. $QS = "UPDATE `{$B}` SET ". implode(",",$POPIN)." WHERE `id`=" . $C['id'];
  33. out_log( $QS );
  34. $A->Query( $QS );
  35. };
  36. function restore_line( $A, $B , $C ){
  37. foreach( $C as $Key=>$Value ){
  38. if( $Key != 'id' ){
  39. $P="`".$Key."`='".$Value."'";
  40. $QS = "UPDATE `{$B}` SET ".$P." WHERE `id`=" . $C['id'];
  41. out_log( $QS );
  42. $A->Query( $QS );
  43. };
  44. };
  45. };
  46. run_command( 'systemctl start argus_nginx');
  47. //run_command( 'systemctl enable argus_nginx');
  48. //run_command( 'systemctl enable argus_shutdown');
  49. run_command( 'systemctl start nginx');
  50. ?>