Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
en:guides:network-script [2010/01/25 19:55] pankso |
en:guides:network-script [2014/10/11 10:44] mojo [Openbox] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Secrets of /etc/init.d/network.sh (cooking) ====== | + | ====== Secrets of /etc/init.d/network.sh ====== |
- | (By linea) | + | |
- | === Introduction === | + | ===== Introduction ===== |
SliTaz launches the /etc/init.d/network.sh at startup to initialize the network. It configures the hostname, loopback interface, and internet connection. | SliTaz launches the /etc/init.d/network.sh at startup to initialize the network. It configures the hostname, loopback interface, and internet connection. | ||
Line 8: | Line 7: | ||
It's also possible to call the script when SliTaz is started, and use it to open or close internet connections. For example netbox and any software linking get-wifi-firmware (get-ipw2100-firmware, get-b43-firmware...) use it. | It's also possible to call the script when SliTaz is started, and use it to open or close internet connections. For example netbox and any software linking get-wifi-firmware (get-ipw2100-firmware, get-b43-firmware...) use it. | ||
- | === Usage === | + | ===== Usage ===== |
By default, /etc/init.d/network.sh uses /etc/network.conf as the conf file. Parameters written in that file are made for the default network connection. | By default, /etc/init.d/network.sh uses /etc/network.conf as the conf file. Parameters written in that file are made for the default network connection. | ||
Line 30: | Line 29: | ||
</code> | </code> | ||
- | But, most interestingly, is that ///etc/init.d/network.sh// may also use another config file. It's useful if you're using a latptop, as you can configure multiple connections for multiple access points. | + | But, most interestingly, is that ///etc/init.d/network.sh// may also use another config file. It's useful if you're using a laptop, as you can configure multiple connections for multiple access points. |
For example, we can create a directory /etc/network, containing some config files, named: | For example, we can create a directory /etc/network, containing some config files, named: | ||
Line 47: | Line 46: | ||
</code> | </code> | ||
- | === Sudo === | + | ===== Sudo ===== |
Since /etc/init.d/network.sh/ can only be used by root, if you want a normal user to use it, you should install sudo: | Since /etc/init.d/network.sh/ can only be used by root, if you want a normal user to use it, you should install sudo: | ||
Line 63: | Line 62: | ||
For user tux, which must use network.sh from every host; without a password you should add: | For user tux, which must use network.sh from every host; without a password you should add: | ||
- | <code bash> | + | <file> |
tux ALL=NOPASSWD: /etc/init.d/network.sh, | tux ALL=NOPASSWD: /etc/init.d/network.sh, | ||
- | </code> | + | </file> |
For user tortux, which may only get connected from localhost, and which should use a password each time, you should add: | For user tortux, which may only get connected from localhost, and which should use a password each time, you should add: | ||
- | <code bash> | + | <file> |
tortux my_hostname=PASSWD: /etc/init.d/network.sh, | tortux my_hostname=PASSWD: /etc/init.d/network.sh, | ||
- | </code> | + | </file> |
If you forgot your hostname, just run: | If you forgot your hostname, just run: | ||
Line 86: | Line 85: | ||
* :q! quit without recording. | * :q! quit without recording. | ||
- | === With Openbox === | + | ===== Openbox ===== |
All this is not that really user friendly... | All this is not that really user friendly... | ||
Line 132: | Line 131: | ||
And now you only have to add these lines in //~/.config/openbox/menu.xml//: | And now you only have to add these lines in //~/.config/openbox/menu.xml//: | ||
- | <code bash> | + | <file> |
- | menu id="network-menu" label="Network" | + | <menu id="network-menu" label="Network" |
execute="/usr/lib/openbox/network-menu.sh" /> | execute="/usr/lib/openbox/network-menu.sh" /> | ||
- | </code> | + | </file> |
Then reconfigure openbox: | Then reconfigure openbox: | ||
Line 144: | Line 143: | ||
Enjoy! | Enjoy! | ||
+ | |||
+ | ---- | ||
+ | \\ | ||
+ | ^ Page Review Section ^^ | ||
+ | |Quality| Good | | ||
+ | |Review| Minor Updates | | ||
+ | |Priority| Medium | | ||
+ | |Problems| add a [[http://forum.slitaz.org|forum post link]]| | ||
+ | |::: | OR add a [[http://labs.slitaz.org/issues |lab issue tracker link ]]| | ||
+ | |How to Improve| Suggest briefly| | ||
+ | |::: | | | ||
+ | |||
+ | \\ | ||
+ | ---- | ||