bashrc, add a reconnect function with aliases.
This commit is contained in:
@@ -1116,6 +1116,46 @@
|
|||||||
done
|
done
|
||||||
sh -c "rm '{{ notify_log_file_wip }}'"
|
sh -c "rm '{{ notify_log_file_wip }}'"
|
||||||
fi
|
fi
|
||||||
|
function_reconnect: |
|
||||||
|
function reconnect {
|
||||||
|
test_domain="git.hyperling.com"
|
||||||
|
test_connection() {
|
||||||
|
ping -c 3 $test_domain
|
||||||
|
}
|
||||||
|
test_connection &&
|
||||||
|
echo -e "\n* Looks good! Not trying anything." &&
|
||||||
|
return 0 ||
|
||||||
|
echo -e "\n* Connection failed, troubleshooting..."
|
||||||
|
|
||||||
|
show_connection() {
|
||||||
|
ip addr | grep ' UP '
|
||||||
|
ip addr | grep ' inet'
|
||||||
|
#ip addr | grep -i 'mullvad'
|
||||||
|
}
|
||||||
|
echo -e "\n* Current Connections:"
|
||||||
|
show_connection
|
||||||
|
|
||||||
|
reset_mullvad() {
|
||||||
|
mullvad disconnect && sleep 5 && mullvad connect && sleep 5
|
||||||
|
}
|
||||||
|
echo -e "\n* Turning Mullvad Off & On Again"
|
||||||
|
reset_mullvad
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
echo -e "\n* Checking Connections"
|
||||||
|
show_connection
|
||||||
|
|
||||||
|
echo -e "\n* Testing Again..."
|
||||||
|
test_connection
|
||||||
|
}
|
||||||
|
alias test_wifi="reconnect"
|
||||||
|
alias test_network="reconnect"
|
||||||
|
alias test_connection="reconnect"
|
||||||
|
alias test_connections="reconnect"
|
||||||
|
alias fix_wifi="reconnect"
|
||||||
|
alias fix_network="reconnect"
|
||||||
|
alias fix_connection="reconnect"
|
||||||
|
alias fix_connections="reconnect"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
@@ -1203,6 +1243,7 @@
|
|||||||
{{ alias_commit }}
|
{{ alias_commit }}
|
||||||
{{ function_loop }}
|
{{ function_loop }}
|
||||||
{{ process_notify_log }}
|
{{ process_notify_log }}
|
||||||
|
{{ function_reconnect }}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .profile + .xsessionrc
|
- name: General | Account Management | Users | Files | .profile + .xsessionrc
|
||||||
blockinfile:
|
blockinfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user