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.

48 lines
1.7 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( 'chown -R www-data:www-data /srv/data');
  16. run_command( 'chmod -R 0775 /srv/data');
  17. run_command( 'ln -s /srv/data /srv/serva/data');
  18. run_command( 'ln -s /srv/data /srv/www/web/lib/controller/data');
  19. //Restore Settings
  20. function restore_whole_line( $A, $B , $C ){
  21. $POPIN = array();
  22. foreach( $C as $Key=>$Value ){
  23. if( $Key != 'id' ){
  24. $POPIN[]="`".$Key."`='".$Value."'";
  25. };
  26. };
  27. $QS = "UPDATE `{$B}` SET ". implode(",",$POPIN)." WHERE `id`=" . $C['id'];
  28. out_log( $QS );
  29. $A->Query( $QS );
  30. };
  31. function restore_line( $A, $B , $C ){
  32. foreach( $C as $Key=>$Value ){
  33. if( $Key != 'id' ){
  34. $P="`".$Key."`='".$Value."'";
  35. $QS = "UPDATE `{$B}` SET ".$P." WHERE `id`=" . $C['id'];
  36. out_log( $QS );
  37. $A->Query( $QS );
  38. };
  39. };
  40. };
  41. run_command( 'systemctl start argus_nginx');
  42. //run_command( 'systemctl enable argus_nginx');
  43. //run_command( 'systemctl enable argus_shutdown');
  44. run_command( 'systemctl start nginx');
  45. ?>