diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-04-15 11:51:43 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-04-15 11:51:43 +0200 |
commit | 6ed6803d0dd8cd3fc93208d614c3558b962a654e (patch) | |
tree | 2cdb4c71787965334f7be6352c5a12c757d30c1b /rc.d/net-profiles | |
parent | c96f443ea84f8041c4b1bdea56f36d9a0d827cf6 (diff) | |
download | netctl-6ed6803d0dd8cd3fc93208d614c3558b962a654e.tar.gz netctl-6ed6803d0dd8cd3fc93208d614c3558b962a654e.tar.xz |
Restore support for kernel command line
It is once again possible to use NET= at the kernel command line when using net-profiles.
Diffstat (limited to 'rc.d/net-profiles')
-rwxr-xr-x | rc.d/net-profiles | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/rc.d/net-profiles b/rc.d/net-profiles index 66f0851..ae9c00e 100755 --- a/rc.d/net-profiles +++ b/rc.d/net-profiles @@ -14,7 +14,7 @@ case "$1" in # Ensure any device renaming has occurred as intended for daemon in "${DAEMONS[@]}"; do - if [[ "$daemon" = "net-rename" ]]; then + if [[ $daemon = net-rename ]]; then if ck_daemon net-rename; then /etc/rc.d/net-rename start fi @@ -22,23 +22,19 @@ case "$1" in done # $NET env var is passed from the kernel boot line - if [[ "$NET" = "menu" ]]; then - if /usr/bin/netcfg-menu; then - mv "$STATE_DIR"/{menu,netcfg-daemon} # JP: user may want to disconnect profile by calling net-profiles stop - add_daemon net-profiles - exit 0 + if [[ -n $NET ]]; then + # Record the connected profile for net-profiles stop + if [[ $NET = menu ]]; then + /usr/bin/netcfg-menu || exit 1 + mv "$STATE_DIR"/{menu,netcfg-daemon} + else + /usr/bin/netcfg check-iface "$NET" || exit 1 + echo "$NET" > "$STATE_DIR/netcfg-daemon" fi - elif [[ -n "$NET" ]]; then - if /usr/bin/netcfg check-iface "$NET"; then - echo "$NET" > "$STATE_DIR/netcfg-daemon" # JP: user may want to disconnect profile by calling net-profiles stop - add_daemon net-profiles - exit 0 - fi - elif /usr/bin/netcfg-daemon start; then - add_daemon net-profiles - else + elif ! /usr/bin/netcfg-daemon start; then exit_err "No profile started." fi + add_daemon net-profiles ;; stop) if ck_daemon net-profiles; then |