What is the command for enabling networking and wireless using command line?
I have made a script that delays the startup apps for quicker boot times.
I have learned that disabling networking also helps in a quicker boot time.
I would like to add a command that shall enable networking and wireless in the shell script.
Are you looking for
sudo service networking start
?I believe
network-manager
handles the networking and interface on Ubuntu 12.04 so it should be like:[EDIT]
Just an update in support of my comment below, for automating
SUDO
when piping the password to it from external source use:Which will not ask for the password interactively.
-S
Switch here makesudo
to read the password from standard input and not from terminal.When using NetworkManager (its service running) there is no need for
sudo
to enable/disable networking.Use
nmcli
:connectivity
get network connectivity state (full/none...).Just for WiFi:
to start network
to stop
to restart
Source