--- alx-src/branches/alx-web-060/mageupgrade.php 2011/05/09 18:44:30 2018 +++ alx-src/branches/alx-web-060/mageupgrade.php 2011/05/09 18:49:28 2019 @@ -35,7 +35,7 @@ if($op=="calc") { echo ' '.strtoupper('Fetching list of packages to upgrade on client #'.$client.' ('.$ip.')...
'); - exec($sshcmd.' '.$ip.' /sbin/mageupgrade --calc-bash',$out,$err); + exec($sshcmd.' '.$ip.' mage uppretend',$out,$err); echo '
';
 				echo '';
 				if (array_key_exists("0", $out))
@@ -66,9 +66,9 @@
 				echo '
'; echo '
'; // hotfix copy a fixed mage.rc - system('scp '.$magerc.' root@'.$ip.':/etc/mage.rc'); + //system('scp '.$magerc.' root@'.$ip.':/etc/mage.rc'); // hotfix2 and a config.rc - system('scp '.$configrc.' root@'.$ip.':/etc/alxconfig-ng/config.rc'); + //system('scp '.$configrc.' root@'.$ip.':/etc/alxconfig-ng/config.rc'); editvar("VERBOSE","off","/etc/mage.rc"); // update rsync server location @@ -93,7 +93,7 @@ // 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"'); + system($sshcmd.' '.$ip.' "NOCOLORS=true mage update"'); echo '
'; echo ''; @@ -105,9 +105,9 @@ echo '
'; #echo 'forcing verbose=off
'; // hotfix copy a fixed mage.rc - system('scp '.$magerc.' root@'.$ip.':/etc/mage.rc'); + //system('scp '.$magerc.' root@'.$ip.':/etc/mage.rc'); // hotfix2 and a config.rc - system('scp '.$configrc.' root@'.$ip.':/etc/alxconfig-ng/config.rc'); + //system('scp '.$configrc.' root@'.$ip.':/etc/alxconfig-ng/config.rc'); editvar("VERBOSE","off","/etc/mage.rc"); // update rsync server location @@ -134,15 +134,15 @@ # check if /usr/sbin/update-alx exists, if not update mage-alx and alxconfig-alx first - exec($sshcmd.' '.$ip.' "[ -x /usr/sbin/update-alx ] && exit 0 || exit 1"',$outarr,$err); + exec($sshcmd.' '.$ip.' "[ -x $(which update-alx) ] && exit 0 || exit 1"',$outarr,$err); if($err!=0) { - echo '"/usr/sbin/update-alx" missing on client "'.$client.'". Updating mage-alx and alxconfig-ng-alx first ...
'; - system($sshcmd.' '.$ip.' "NOCOLORS=true /sbin/mage install mage-alx"'); - system($sshcmd.' '.$ip.' "NOCOLORS=true /sbin/mage install alxconfig-ng-alx"'); + echo '"update-alx" missing on client "'.$client.'". Updating mage and alxconfig-ng first ...
'; + system($sshcmd.' '.$ip.' "NOCOLORS=true mage install mage"'); + system($sshcmd.' '.$ip.' "NOCOLORS=true mage install alxconfig-ng"'); } - //system($sshcmd.' '.$ip.' "NOCOLORS=true /usr/sbin/update-alx"'); - exec($sshcmd.' '.$ip.' "NOCOLORS=true /usr/sbin/update-alx && exit 0 || exit 1"',$outarr,$err); + //system($sshcmd.' '.$ip.' "NOCOLORS=true update-alx"'); + exec($sshcmd.' '.$ip.' "NOCOLORS=true update-alx && exit 0 || exit 1"',$outarr,$err); echo '
'; if ($err!=0) echo ''; else echo '';