Skip to content

Instantly share code, notes, and snippets.

@arcan1s
Created February 15, 2016 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcan1s/500ce9285ffb203f743f to your computer and use it in GitHub Desktop.
Save arcan1s/500ce9285ffb203f743f to your computer and use it in GitHub Desktop.
/bin/bash -x /usr/bin/netctl-auto list
+ . /usr/lib/network/globals
++ NETCTL_VERSION=1.11
++ PROFILE_DIR=/etc/netctl
++ SUBR_DIR=/usr/lib/network
++ STATE_DIR=/run/network
++ STATE_FILE=/var/lib/netctl/netctl.state
++ do_readable :
++ local result
++ umask 022
++ :
++ result=0
++ umask 077
++ return 0
+ . /usr/lib/network/wpa
+ . /usr/lib/network/rfkill
+ : wpa_actiond -p /run/wpa_supplicant
+ : /usr/lib/network/auto.action
+ case $# in
+ case $1 in
+ list
+ local interface id flag profile
+ read -r interface id flag profile
++ list_wpa_profiles
++ local interface
+++ list_netctl_auto_interfaces
+++ systemctl --full --no-legend --no-pager --type=service --state=running list-units
+++ sed -nr 's/^netctl-auto@([[:alnum:]]+).*/\1/p'
++ for interface in '$(list_netctl_auto_interfaces)'
++ local id ssid bssid flags
++ IFS=' '
++ read -r id ssid bssid flags
+++ wpa_call wifi0 list_networks
+++ tail -n+2
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 list_networks
+++ report_debug wpa_call: wpa_cli -i wifi0 list_networks
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 list_networks
++ local flag=e
++ [[ [CURRENT] =~ \[CURRENT] ]]
++ flag=a
+++ wpa_call wifi0 get_network 0 id_str
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 0 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 0 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 0 id_str
++ local profile=FAIL
+++ wpa_unquote FAIL
+++ local string=FAIL
+++ [[ FAIL == \"*\" ]]
+++ [[ FAIL == +([[:xdigit:]][[:xdigit:]]) ]]
+++ printf %s FAIL
++ profile=FAIL
++ echo wifi0 0 a FAIL
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 1 id_str
++ echo a
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
++ tr aed '* !'
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 1 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 1 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 1 id_str
+ echo '*' FAIL
* FAIL
+ read -r interface id flag profile
++ local 'profile="273"'
+++ wpa_unquote '"273"'
+++ local 'string="273"'
+++ [[ "273" == \"*\" ]]
+++ printf %s 273
++ profile=273
++ echo wifi0 1 e 273
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 2 id_str
++ echo e
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
++ tr aed '* !'
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 2 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 2 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 2 id_str
+ echo ' ' 273
273
+ read -r interface id flag profile
++ local 'profile="wifi0-437k"'
+++ wpa_unquote '"wifi0-437k"'
+++ local 'string="wifi0-437k"'
+++ [[ "wifi0-437k" == \"*\" ]]
+++ printf %s wifi0-437k
++ profile=wifi0-437k
++ echo wifi0 2 e wifi0-437k
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 3 id_str
++ echo e
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 3 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 3 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 3 id_str
++ tr aed '* !'
+ echo ' ' wifi0-437k
wifi0-437k
+ read -r interface id flag profile
++ local 'profile="c47"'
+++ wpa_unquote '"c47"'
+++ local 'string="c47"'
+++ [[ "c47" == \"*\" ]]
+++ printf %s c47
++ profile=c47
++ echo wifi0 3 e c47
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
++ echo e
+++ wpa_call wifi0 get_network 4 id_str
+++ args=("-i" "$1")
+++ local args
++ tr aed '* !'
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 4 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 4 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 4 id_str
+ echo ' ' c47
c47
+ read -r interface id flag profile
++ local 'profile="exante"'
+++ wpa_unquote '"exante"'
+++ local 'string="exante"'
+++ [[ "exante" == \"*\" ]]
+++ printf %s exante
++ profile=exante
++ echo wifi0 4 e exante
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 5 id_str
++ echo e
+++ args=("-i" "$1")
+++ local args
+++ shift
+++ [[ -n '' ]]
++ tr aed '* !'
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 5 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 5 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 5 id_str
+ echo ' ' exante
exante
+ read -r interface id flag profile
++ local 'profile="543"'
+++ wpa_unquote '"543"'
+++ local 'string="543"'
+++ [[ "543" == \"*\" ]]
+++ printf %s 543
++ profile=543
++ echo wifi0 5 e 543
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
++ echo e
+++ wpa_call wifi0 get_network 6 id_str
+++ args=("-i" "$1")
+++ local args
++ tr aed '* !'
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 6 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 6 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 6 id_str
+ echo ' ' 543
543
+ read -r interface id flag profile
++ local 'profile="arcanis_ideapad"'
+++ wpa_unquote '"arcanis_ideapad"'
+++ local 'string="arcanis_ideapad"'
+++ [[ "arcanis_ideapad" == \"*\" ]]
+++ printf %s arcanis_ideapad
++ profile=arcanis_ideapad
++ echo wifi0 6 e arcanis_ideapad
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 7 id_str
++ echo e
+++ args=("-i" "$1")
+++ local args
++ tr aed '* !'
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 7 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 7 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 7 id_str
+ echo ' ' arcanis_ideapad
arcanis_ideapad
+ read -r interface id flag profile
++ local 'profile="arcanis"'
+++ wpa_unquote '"arcanis"'
+++ local 'string="arcanis"'
+++ [[ "arcanis" == \"*\" ]]
+++ printf %s arcanis
++ profile=arcanis
++ echo wifi0 7 e arcanis
++ IFS=' '
++ read -r id ssid bssid flags
++ local flag=e
++ [[ '' =~ \[CURRENT] ]]
++ [[ '' =~ \[DISABLED] ]]
+++ wpa_call wifi0 get_network 8 id_str
++ echo e
+++ args=("-i" "$1")
+++ local args
++ tr aed '* !'
+++ shift
+++ [[ -n '' ]]
+++ [[ -n '' ]]
+++ do_debug wpa_cli -i wifi0 get_network 8 id_str
+++ report_debug wpa_call: wpa_cli -i wifi0 get_network 8 id_str
+++ is_yes no
+++ case ${1,,} in
+++ return 1
+++ wpa_cli -i wifi0 get_network 8 id_str
+ echo ' ' arcanis
arcanis
+ read -r interface id flag profile
++ local 'profile="home"'
+++ wpa_unquote '"home"'
+++ local 'string="home"'
+++ [[ "home" == \"*\" ]]
+++ printf %s home
++ profile=home
++ echo wifi0 8 e home
++ IFS=' '
++ read -r id ssid bssid flags
++ echo e
++ tr aed '* !'
+ echo ' ' home
home
+ read -r interface id flag profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment