diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/network b/src/network index 6a46e02..f2fc415 100644 --- a/src/network +++ b/src/network @@ -13,7 +13,7 @@ err_append() { } err() { - printhl "$*" + printhl "$*" } ### Profile loading @@ -52,7 +52,6 @@ validate_profile() all_down() { for prof in "$(find ${STATE_DIR}/profiles/ -maxdepth 1 -type f -printf '%f\n')"; do - profile_down $prof done } @@ -65,7 +64,7 @@ all_suspend() [[ ! -d $STATE_DIR ]] && mkdir -p $STATE_DIR/{interfaces,profiles} [[ ! -d $STATE_DIR/suspend ]] && mkdir $STATE_DIR/suspend - for $prof in find "$STATE_DIR/profiles/" -maxdepth 1 -type f; do + for prof in find "$STATE_DIR/profiles/" -maxdepth 1 -type f; do cp $STATE_DIR/profiles/$prof $STATE_DIR/suspend/ profile_down $prof done @@ -76,7 +75,7 @@ all_suspend() # all_resume() { - for $prof in find "$STATE_DIR/suspend/" -maxdepth 1 -type f; do + for prof in find "$STATE_DIR/suspend/" -maxdepth 1 -type f; do profile_up $prof rm $STATE_DIR/suspend/$prof done @@ -113,7 +112,6 @@ profile_up() load_profile $1 fi fi - eval $PRE_UP || exit 1 @@ -170,19 +168,19 @@ profile_down() # Check if variable is a member of an array inarray() { -search=$1 -shift -for item in $*; do - if [[ "$item" == "$search" ]]; then - return 0 - fi -done -return 1 + search=$1 + shift + for item in $*; do + if [[ "$item" == "$search" ]]; then + return 0 + fi + done + return 1 } quirk() { -inarray $1 ${QUIRKS[@]} -return $? + inarray $1 ${QUIRKS[@]} + return $? } # interface_down interface |