diff --git a/doraemon.spec b/doraemon.spec index 4fb75f8..153c009 100644 --- a/doraemon.spec +++ b/doraemon.spec @@ -79,7 +79,7 @@ if [ "$1" = 2 ]; then if [ -f $DATABASE ]; then sqlite3 -separator " " $DATABASE \ "select * from client" | while read id hostname mac role; do - /sbin/e-smith/db hosts set $hostname remote \ + /sbin/e-smith/db hosts set $hostname local \ MacAddress $mac Role $role done rm $DATABASE diff --git a/root/etc/e-smith/events/actions/doraemon-reboot-all b/root/etc/e-smith/events/actions/doraemon-reboot-all index 1e8d739..8036c82 100755 --- a/root/etc/e-smith/events/actions/doraemon-reboot-all +++ b/root/etc/e-smith/events/actions/doraemon-reboot-all @@ -10,7 +10,7 @@ use English; my $db_hosts = esmith::DB::db->open('hosts') || die("Could not open e-smith db (" . esmith::DB::db->error . ")\n"); -my @items = $db_hosts->get_all('remote'); +my @items = $db_hosts->get_all('local'); foreach my $item (@items) { my $hostName = $item->key; system("/usr/bin/sudo -u amgmt /usr/bin/ssh -o StrictHostKeyChecking=no amgmt\@$hostName /usr/bin/sudo /sbin/reboot &") == 0 diff --git a/root/etc/e-smith/events/actions/doraemon-shutdown-all b/root/etc/e-smith/events/actions/doraemon-shutdown-all index 5df4213..cd0a5b1 100755 --- a/root/etc/e-smith/events/actions/doraemon-shutdown-all +++ b/root/etc/e-smith/events/actions/doraemon-shutdown-all @@ -10,7 +10,7 @@ use English; my $db_hosts = esmith::DB::db->open('hosts') || die("Could not open e-smith db (" . esmith::DB::db->error . ")\n"); -my @items = $db_hosts->get_all('remote'); +my @items = $db_hosts->get_all('local'); foreach my $item (@items) { my $hostName = $item->key; system("/usr/bin/sudo -u amgmt /usr/bin/ssh -o StrictHostKeyChecking=no amgmt\@$hostName /usr/bin/sudo /sbin/poweroff &") == 0 diff --git a/root/etc/e-smith/events/actions/doraemon-wake-all b/root/etc/e-smith/events/actions/doraemon-wake-all index 39f97e2..274d231 100755 --- a/root/etc/e-smith/events/actions/doraemon-wake-all +++ b/root/etc/e-smith/events/actions/doraemon-wake-all @@ -10,7 +10,7 @@ use English; my $db_hosts = esmith::DB::db->open('hosts') || die("Could not open e-smith db (" . esmith::DB::db->error . ")\n"); -my @items = $db_hosts->get_all('remote'); +my @items = $db_hosts->get_all('local'); foreach my $item (@items) { my $hostName = $item->key; my $mac = $item->prop('MacAddress'); diff --git a/root/usr/share/doraemon/index.php b/root/usr/share/doraemon/index.php index ae2f3bf..842a624 100644 --- a/root/usr/share/doraemon/index.php +++ b/root/usr/share/doraemon/index.php @@ -108,7 +108,7 @@ function newHostname($mac, $base, $role) { # } } while ($hosts_db->getKey($hostname)); - $hosts_db->setKey($hostname, 'remote', array( + $hosts_db->setKey($hostname, 'local', array( 'MacAddress' => $mac, 'Role' => $role, 'Description' => '' @@ -165,7 +165,7 @@ function ROUTE_hosts() { if (isset($get_params['role'])) { $items = $hosts_db->getAllByProp('Role', $get_params['role']); } else { - $items = $hosts_db->getAll('remote'); + $items = $hosts_db->getAll('local'); } $results=array(); foreach ($items as $name=>$item) { diff --git a/root/usr/share/nethesis/NethServer/Module/Doraemon/Hosts.php b/root/usr/share/nethesis/NethServer/Module/Doraemon/Hosts.php index e898502..ca90f1f 100644 --- a/root/usr/share/nethesis/NethServer/Module/Doraemon/Hosts.php +++ b/root/usr/share/nethesis/NethServer/Module/Doraemon/Hosts.php @@ -16,7 +16,7 @@ class Hosts extends \Nethgui\Controller\TableController ); $this - ->setTableAdapter($this->getPlatform()->getTableAdapter('hosts', 'remote')) + ->setTableAdapter($this->getPlatform()->getTableAdapter('hosts', 'local')) ->setColumns($columns) ->addRowAction(new \NethServer\Module\Doraemon\Hosts\Modify('update')) ->addRowAction(new \NethServer\Module\Doraemon\Hosts\TogglePower('wake'))