--- alx-src/branches/alx-web-050/mageupgrade.php 2010/12/02 23:02:19 1610 +++ alx-src/branches/alx-web-050/mageupgrade.php 2010/12/09 22:16:42 1629 @@ -77,7 +77,24 @@ editvar("MAGE_RSYNC",$rsync,"/etc/alxconfig-ng/config.rc"); editvar("RSYNC",$rsync,"/etc/mage.rc"); + // update repository server location + $repository = sqlfirst('select client_locations.repository from client_serials inner join client_locations on client_locations.location=client_serials.location and client_serials.serial='.$client, 'repository'); + editvar("MAGE_MIRRORS",$repository,"/etc/alxconfig-ng/config.rc"); + editvar("MIRRORS",$repository,"/etc/mage.rc"); + + // update samba update host + $updateserver = sqlfirst('select client_locations.updateserver from client_serials inner join client_locations on client_locations.location=client_serials.location and client_serials.serial='.$client, 'updateserver'); + editvar("SMB_UPDATE_HOST",$updateserver,"/etc/alxconfig-ng/config.rc"); + + // update samba update user + $smbusername = sqlfirst('select client_locations.username from client_serials inner join client_locations on client_locations.location=client_serials.location and client_serials.serial='.$client, 'username'); + editvar("SMB_UPDATE_USER",$smbusername,"/etc/alxconfig-ng/config.rc"); + + // update samba update password + $smbpassword = sqlfirst('select client_locations.password from client_serials inner join client_locations on client_locations.location=client_serials.location and client_serials.serial='.$client, 'password'); + editvar("SMB_UPDATE_PASS",$smbpassword,"/etc/alxconfig-ng/config.rc"); system($sshcmd.' '.$ip.' "NOCOLORS=true /sbin/mage update"'); + echo ''; echo ''; }