Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI command via script #511

Open
andredemori opened this issue Oct 24, 2023 · 6 comments
Open

CLI command via script #511

andredemori opened this issue Oct 24, 2023 · 6 comments

Comments

@andredemori
Copy link

Is there any way to run a command in the CLI per line of code?

I need to run the following command:

mininet-wifi> sh ifconfig hwsim0 up

but i need to run it via script and not via terminal. Is there a way to include this command in my code?

@ramonfontes
Copy link
Member

ramonfontes commented Oct 24, 2023

You can run that command from any node running at root ns.

node.cmd('command')

@andredemori
Copy link
Author

I tried, but in Wireshark, when I select hwsim0 it says the device is still down. Only works via CLI.

@ramonfontes
Copy link
Member

Did you bring the interface up??

@andredemori
Copy link
Author

andredemori commented Oct 24, 2023

i'm trying to do it in the code, but only works via CLI

sta1.cmd('sh ifconfig hwsim0 up') --> not works

mininet-wifi> sh ifconfig hwsim0 up --> works

I don't know if there is a way to run this command in the code. only via CLI. Do you know a way?

@ramonfontes
Copy link
Member

ramonfontes commented Oct 24, 2023

Is sta1 running at root NS?? And why are you using sh??

@andredemori
Copy link
Author

sorry. I don't know how to run sta1 at root NS.

I run with sh because it not works without sh

mininet-wifi> ifconfig hwsim0 up
*** Unknown command: ifconfig hwsim0 up

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants