Remove more connect-to-network sections
This commit is contained in:
parent
ceb6a9e294
commit
c4755124a0
3 changed files with 0 additions and 54 deletions
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/python3
|
|
||||||
#
|
|
||||||
## Wizard Kit: Network connection tool
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Init
|
|
||||||
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
|
||||||
from functions.network import *
|
|
||||||
init_global_vars()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
try:
|
|
||||||
# Prep
|
|
||||||
clear_screen()
|
|
||||||
|
|
||||||
# Connect
|
|
||||||
connect_to_network()
|
|
||||||
|
|
||||||
# Done
|
|
||||||
print_standard('\nDone.')
|
|
||||||
#pause("Press Enter to exit...")
|
|
||||||
exit_script()
|
|
||||||
except SystemExit:
|
|
||||||
pass
|
|
||||||
except:
|
|
||||||
major_exception()
|
|
||||||
|
|
||||||
# vim: sts=2 sw=2 ts=2
|
|
||||||
|
|
@ -15,27 +15,6 @@ REGEX_VALID_IP = re.compile(
|
||||||
re.IGNORECASE)
|
re.IGNORECASE)
|
||||||
|
|
||||||
|
|
||||||
def connect_to_network():
|
|
||||||
"""Connect to network if not already connected."""
|
|
||||||
net_ifs = psutil.net_if_addrs()
|
|
||||||
net_ifs = [i[:2] for i in net_ifs.keys()]
|
|
||||||
|
|
||||||
# Bail if currently connected
|
|
||||||
if is_connected():
|
|
||||||
return
|
|
||||||
|
|
||||||
# WiFi
|
|
||||||
if 'wl' in net_ifs:
|
|
||||||
cmd = [
|
|
||||||
'nmcli', 'dev', 'wifi',
|
|
||||||
'connect', WIFI_SSID,
|
|
||||||
'password', WIFI_PASSWORD]
|
|
||||||
try_and_print(
|
|
||||||
message = 'Connecting to {}...'.format(WIFI_SSID),
|
|
||||||
function = run_program,
|
|
||||||
cmd = cmd)
|
|
||||||
|
|
||||||
|
|
||||||
def is_connected():
|
def is_connected():
|
||||||
"""Check for a valid private IP."""
|
"""Check for a valid private IP."""
|
||||||
devs = psutil.net_if_addrs()
|
devs = psutil.net_if_addrs()
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,6 @@ QUICKBOOKS_SERVER_IP='10.0.0.10'
|
||||||
# Time Zones
|
# Time Zones
|
||||||
LINUX_TIME_ZONE='America/Denver' # See 'timedatectl list-timezones' for valid values
|
LINUX_TIME_ZONE='America/Denver' # See 'timedatectl list-timezones' for valid values
|
||||||
WINDOWS_TIME_ZONE='Mountain Standard Time' # See 'tzutil /l' for valid values
|
WINDOWS_TIME_ZONE='Mountain Standard Time' # See 'tzutil /l' for valid values
|
||||||
# WiFi
|
|
||||||
WIFI_SSID='SomeWiFi'
|
|
||||||
WIFI_PASSWORD='Abracadabra'
|
|
||||||
|
|
||||||
# SERVER VARIABLES
|
# SERVER VARIABLES
|
||||||
## NOTE: Windows can only use one user per server. This means that if
|
## NOTE: Windows can only use one user per server. This means that if
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue