Skip to content

Commit

Permalink
20150828
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Dainese committed Aug 28, 2015
1 parent b4fd433 commit 1cf08a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0-70
0.9.0-72
10 changes: 6 additions & 4 deletions html/includes/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @copyright 2014-2015 Andrea Dainese
* @license http://www.gnu.org/licenses/gpl.html
* @link http://www.unetlab.com/
* @version 20150826
* @version 20150828
*/

/**
Expand Down Expand Up @@ -519,11 +519,13 @@ function export($node_id, $n, $lab) {
*/
function isBridge($s) {
$cmd = 'brctl show '.$s.' 2>&1';
error_log($cmd);
exec($cmd, $o, $rc);
if (preg_match('/can\'t get info No such device/', $o[1])) {
return False;
} else {
if (preg_match('/8000/', $o[1])) {
// "brctl show" on a ovs bridge or on a non-existent bridge return 0 -> check for 8000
return True;
} else {
return False;
}
}

Expand Down
4 changes: 2 additions & 2 deletions html/themes/default/includes/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/lab_open.php?filename=<?php print $_GET['filename'] ?>"><i class="glyphicon glyphicon-folder-open"></i> Open this lab</a></li>
<li><a href="/lab_open.php?filename=<?php print $_GET['filename'] ?>&tenant=<?php print $_GET['tenant'] ?>"><i class="glyphicon glyphicon-folder-open"></i> Open this lab</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation" class="dropdown-header">Add elements</li>
<li><a class="network_add" href="#"><i class="glyphicon glyphicon-transfer"></i> Networks</a></li>
Expand All @@ -34,7 +34,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/lab_edit.php?filename=<?php print $_GET['filename'] ?>"><i class="glyphicon glyphicon-edit"></i> Edit this lab</a></li>
<li><a href="/lab_edit.php?filename=<?php print $_GET['filename'] ?>&tenant=<?php print $_GET['tenant'] ?>"><i class="glyphicon glyphicon-edit"></i> Edit this lab</a></li>
<li class="divider"></li>
<li><a class="node_start_all" href="#"><i class="glyphicon glyphicon-play"></i> Start all nodes</a></li>
<li><a class="node_stop_all" href="#"><i class="glyphicon glyphicon-stop"></i> Stop all nodes</a></li>
Expand Down
8 changes: 7 additions & 1 deletion wrappers/unl_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @copyright 2014-2015 Andrea Dainese
* @license http://www.gnu.org/licenses/gpl.html
* @link http://www.unetlab.com/
* @version 20150715
* @version 20150828
*/

require_once('/opt/unetlab/html/includes/init.php');
Expand Down Expand Up @@ -169,6 +169,12 @@
// Wrappers
$cmd = '/bin/chmod 755 /opt/unetlab/wrappers/*_wrapper* > /dev/null 2>&1';
exec($cmd, $o, $rc);

// /tmp
$cmd = '/bin/chown root:root /tmp 2>&1';
exec($cmd, $o, $rc);
$cmd = '/bin/chmod u=rwx,g=rwx,o=rwxt /tmp > /dev/null 2>&1';
exec($cmd, $o, $rc);
break;
case 'platform':
$cmd = '/usr/sbin/dmidecode -s system-product-name';
Expand Down

0 comments on commit 1cf08a4

Please sign in to comment.