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

<?php
// require_once( $WDIR . '/inst_lib.php');
echo "\n\n\nAFTER!!\n\n\n";
$DBHost="localhost";
$DBName="argus";
$DBUser="argus";
$DBPassword="Jc8zYWEhqGAGGYJRum92tm";
run_command( 'cp -f /srv/etc/ag_nginx/argus_nginx.service /etc/systemd/system/argus_nginx.service');
run_command( 'cp -f /srv/etc/argus_shutdown.service /etc/systemd/system/argus_shutdown.service');
run_command( 'systemctl enable argus_nginx');
run_command( 'systemctl enable argus_shutdown');
run_command( 'systemctl daemon-reload');
run_command( 'cp -f /srv/etc/nginx/default /etc/nginx/sites-available/default');
run_command( 'cp -f /srv/etc/rc.local /etc/rc.local');
run_command( 'md /srv/data/composed_videos');
run_command( 'chown -R www-data:www-data /srv/data');
run_command( 'chown -R www-data:www-data /srv/etc');
run_command( 'chown -R www-data:www-data /srv/data/composed_videos');
run_command( 'chmod -R 0775 /srv/data');
run_command( 'ln -s /srv/data /srv/serva/data');
run_command( 'ln -s /srv/data /srv/www/server/lib/controller/data');
//Run Database Upgrade
run_command( 'cd /srv/www/server/lib; php ./upgrade_database.php');
// Check Folders
if( !file_exists( '/srv/data/composed_videos' ) ){
mkdir( '/srv/data/composed_videos' );
chown( '/srv/data/composed_videos', "www-data" );
chgrp( '/srv/data/composed_videos', "www-data" );
chmod( '/srv/data/composed_videos', 0775 );
} else {
chown( '/srv/data/composed_videos', "www-data" );
chgrp( '/srv/data/composed_videos', "www-data" );
chmod( '/srv/data/composed_videos', 0775 );
};
//Restore Settings
function restore_whole_line( $A, $B , $C ){
$POPIN = array();
foreach( $C as $Key=>$Value ){
if( $Key != 'id' ){
$POPIN[]="`".$Key."`='".$Value."'";
};
};
$QS = "UPDATE `{$B}` SET ". implode(",",$POPIN)." WHERE `id`=" . $C['id'];
out_log( $QS );
$A->Query( $QS );
};
function restore_line( $A, $B , $C ){
foreach( $C as $Key=>$Value ){
if( $Key != 'id' ){
$P="`".$Key."`='".$Value."'";
$QS = "UPDATE `{$B}` SET ".$P." WHERE `id`=" . $C['id'];
out_log( $QS );
$A->Query( $QS );
};
};
};
run_command( 'systemctl start argus_nginx');
//run_command( 'systemctl enable argus_nginx');
//run_command( 'systemctl enable argus_shutdown');
run_command( 'systemctl start nginx');
?>