Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
117 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,4 @@ | ||
#!/bin/bash | ||
|
||
python $NETKIT_HOME/python/check.py "$PWD/" "$@" | ||
|
||
export ADAPTER_BIN=$(python $NETKIT_HOME/python/adapter.py) | ||
|
||
NETKIT_ALL=1 | ||
NETKIT_LIST=0 | ||
NETKIT_APP_PREV=$0 | ||
for i in "$@" | ||
do | ||
case $i in | ||
--list) | ||
NETKIT_APP_PREV=$i | ||
NETKIT_LIST=1 | ||
#shift | ||
;; | ||
-*) | ||
NETKIT_APP_PREV=$i | ||
#shift | ||
;; | ||
*) | ||
if [ "$NETKIT_APP_PREV" != "-d" ]; then | ||
$ADAPTER_BIN stop netkit_${UID}_$i; NETKIT_ALL=0 | ||
fi | ||
NETKIT_APP_PREV=$i | ||
#shift | ||
;; | ||
esac | ||
done | ||
|
||
export RC=$? | ||
if [ "$RC" = "0" ]; then | ||
echo -e "\033[0;33mContainers will be stopped (gracefully) but not deleted\033[0m" | ||
M=_machines | ||
L=_links | ||
if [ "$NETKIT_ALL" = "1" ]; then | ||
python $NETKIT_HOME/python/folder_hash.py "$PWD/" "$@" | while read in; do ( | ||
if [ -f "$HOME/netkit_temp/$in$M" ]; then | ||
$ADAPTER_BIN stop `cat "$HOME/netkit_temp/$in$M"` | ||
fi | ||
); done | ||
fi | ||
|
||
if [ "$NETKIT_LIST" = "1" ]; then | ||
$ADAPTER_BIN stats --no-stream ; $ADAPTER_BIN network list | ||
fi | ||
|
||
else | ||
echo FAILED | ||
fi | ||
echo -e "\033[0;33mDeprecated, will run lclean instead. To run the old lhalt specifically use lhalt_legacy\033[0m" | ||
$NETKIT_HOME/lclean "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,4 @@ | ||
@echo off | ||
|
||
FOR /F "tokens=*" %%a in ('python %NETKIT_HOME%\python\adapter.py') DO SET ADAPTER_BIN=%%a | ||
|
||
python %NETKIT_HOME%\python\check.py "%cd%/" %* | ||
IF ERRORLEVEL 1 GOTO END | ||
|
||
SET NETKIT_LIST=0 | ||
SET NETKIT_APP=%1 | ||
SET NETKIT_APP_PREV=%0 | ||
FOR %%p in (%*) DO ( | ||
SET NETKIT_APP=%%p | ||
IF "%%p" == "--list" ( | ||
SET NETKIT_LIST=1 | ||
) | ||
IF NOT "%NETKIT_APP:~0,1%" == "-" ( | ||
IF NOT "%NETKIT_APP_PREV%" == "-d" ( | ||
SET NETKIT_ALL=0 | ||
%ADAPTER_BIN% stop netkit_nt_%%p | ||
) | ||
) | ||
SET NETKIT_APP_PREV=%%p | ||
) | ||
|
||
IF "%NETKIT_ALL%" == "1" ( | ||
ECHO "Containers will be stopped (gracefully) but not deleted" | ||
FOR /F "tokens=*" %%a in ('python %NETKIT_HOME%\python\folder_hash.py "%cd%/" %*') DO SET VAR1=%NETKIT_HOME%\temp\%%a_machines | ||
IF exist %VAR1% ( | ||
FOR /f "delims=" %%a in (%VAR1%) DO %ADAPTER_BIN% stop %%a | ||
) | ||
) | ||
|
||
IF "%NETKIT_LIST%" == "1" %ADAPTER_BIN% stats --no-stream & %ADAPTER_BIN% network list | ||
|
||
:END | ||
ECHO "Deprecated, will run lclean instead. To run the old lhalt specifically use lhalt_legacy" | ||
%NETKIT_HOME%/lclean %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
python $NETKIT_HOME/python/check.py "$PWD/" "$@" | ||
|
||
export ADAPTER_BIN=$(python $NETKIT_HOME/python/adapter.py) | ||
|
||
NETKIT_ALL=1 | ||
NETKIT_LIST=0 | ||
NETKIT_APP_PREV=$0 | ||
for i in "$@" | ||
do | ||
case $i in | ||
--list) | ||
NETKIT_APP_PREV=$i | ||
NETKIT_LIST=1 | ||
#shift | ||
;; | ||
-*) | ||
NETKIT_APP_PREV=$i | ||
#shift | ||
;; | ||
*) | ||
if [ "$NETKIT_APP_PREV" != "-d" ]; then | ||
$ADAPTER_BIN stop netkit_${UID}_$i; NETKIT_ALL=0 | ||
fi | ||
NETKIT_APP_PREV=$i | ||
#shift | ||
;; | ||
esac | ||
done | ||
|
||
export RC=$? | ||
if [ "$RC" = "0" ]; then | ||
echo -e "\033[0;33mContainers will be stopped (gracefully) but not deleted\033[0m" | ||
M=_machines | ||
L=_links | ||
if [ "$NETKIT_ALL" = "1" ]; then | ||
python $NETKIT_HOME/python/folder_hash.py "$PWD/" "$@" | while read in; do ( | ||
if [ -f "$HOME/netkit_temp/$in$M" ]; then | ||
$ADAPTER_BIN stop `cat "$HOME/netkit_temp/$in$M"` | ||
fi | ||
); done | ||
fi | ||
|
||
if [ "$NETKIT_LIST" = "1" ]; then | ||
$ADAPTER_BIN stats --no-stream ; $ADAPTER_BIN network list | ||
fi | ||
|
||
else | ||
echo FAILED | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@echo off | ||
|
||
FOR /F "tokens=*" %%a in ('python %NETKIT_HOME%\python\adapter.py') DO SET ADAPTER_BIN=%%a | ||
|
||
python %NETKIT_HOME%\python\check.py "%cd%/" %* | ||
IF ERRORLEVEL 1 GOTO END | ||
|
||
SET NETKIT_LIST=0 | ||
SET NETKIT_APP=%1 | ||
SET NETKIT_APP_PREV=%0 | ||
FOR %%p in (%*) DO ( | ||
SET NETKIT_APP=%%p | ||
IF "%%p" == "--list" ( | ||
SET NETKIT_LIST=1 | ||
) | ||
IF NOT "%NETKIT_APP:~0,1%" == "-" ( | ||
IF NOT "%NETKIT_APP_PREV%" == "-d" ( | ||
SET NETKIT_ALL=0 | ||
%ADAPTER_BIN% stop netkit_nt_%%p | ||
) | ||
) | ||
SET NETKIT_APP_PREV=%%p | ||
) | ||
|
||
IF "%NETKIT_ALL%" == "1" ( | ||
ECHO "Containers will be stopped (gracefully) but not deleted" | ||
FOR /F "tokens=*" %%a in ('python %NETKIT_HOME%\python\folder_hash.py "%cd%/" %*') DO SET VAR1=%NETKIT_HOME%\temp\%%a_machines | ||
IF exist %VAR1% ( | ||
FOR /f "delims=" %%a in (%VAR1%) DO %ADAPTER_BIN% stop %%a | ||
) | ||
) | ||
|
||
IF "%NETKIT_LIST%" == "1" %ADAPTER_BIN% stats --no-stream & %ADAPTER_BIN% network list | ||
|
||
:END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 1 ]; then | ||
echo Usage: $0 machine_name | ||
exit 1 | ||
fi | ||
|
||
|
||
$NETKIT_HOME/lhalt -d "$HOME/netkit_temp/labs/netkit_${UID}_${@: -1}" ${@: -1} | ||
echo -e "\033[0;33mDeprecated, will run vclean instead. To run the old vhalt specifically use vhalt_legacy\033[0m" | ||
$NETKIT_HOME/vclean "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
@echo off | ||
|
||
IF [%1]==[] GOTO USAGE | ||
|
||
FOR %%a in (%*) do SET NETKIT_LASTARG=%%a | ||
|
||
CALL %NETKIT_HOME%\lhalt -d %NETKIT_HOME%\temp/labs/netkit_nt_%NETKIT_LASTARG% %NETKIT_LASTARG% | ||
|
||
GOTO END | ||
|
||
:USAGE | ||
ECHO Usage: %0 machine_name | ||
|
||
:END | ||
ECHO "Deprecated, will run vclean instead. To run the old vhalt specifically use vhalt_legacy" | ||
%NETKIT_HOME%/vclean %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 1 ]; then | ||
echo Usage: $0 machine_name | ||
exit 1 | ||
fi | ||
|
||
|
||
$NETKIT_HOME/lhalt_legacy -d "$HOME/netkit_temp/labs/netkit_${UID}_${@: -1}" ${@: -1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo off | ||
|
||
IF [%1]==[] GOTO USAGE | ||
|
||
FOR %%a in (%*) do SET NETKIT_LASTARG=%%a | ||
|
||
CALL %NETKIT_HOME%\lhalt_legacy -d %NETKIT_HOME%\temp/labs/netkit_nt_%NETKIT_LASTARG% %NETKIT_LASTARG% | ||
|
||
GOTO END | ||
|
||
:USAGE | ||
ECHO Usage: %0 machine_name | ||
|
||
:END |