How to inactivate network service by terminal on mac os x?

2

1

I google but found nothing helpful. the above link was useful when I wanted to create service of any other configuration commands on terminal but I found nothing about how to inactive a service by command line. I could do this by clicking on the button on GUI on System preferences but I need command line command to create script and just click on it to activate or activated 30 service at ones.

Mac networksetup command

Ehsan

Posted 2014-05-10T05:18:36.733

Reputation: 91

Will 'ifconfig <iface> down' do the trick? – MaQleod – 2014-05-10T06:28:31.103

Answers

6

I found the solution this command help me on terminal command line:

networksetup [-setnetworkserviceenabled networkservice on | off]

thanks to (man) command on terminal that help me to find my way.

To list available services, run:

sudo networksetup -listallnetworkservices

Ehsan

Posted 2014-05-10T05:18:36.733

Reputation: 91

0

Here you have the terminal command, type it then press return and enter your admin password:

sudo ifconfig en1 down

you can replace down with up to enable it back, e.g. en0 for ethernet, en1 for Wi-Fi (depending on your Mac).

Shamy

Posted 2014-05-10T05:18:36.733

Reputation: 21

No my question is how to down or up service with command line. Your answer is work on interfaces not services. For showing your network services type this command on your terminal. (networksetup -listnetworkserviceorder) – Ehsan – 2014-05-16T18:45:06.413

thanks i used your answer and search on terminal by man command and finally find my answer. – Ehsan – 2014-05-16T18:54:42.360

Congrats :D happy for you – Shamy – 2014-05-16T19:00:15.717