Revert "Wait for network instead of sleeping"
This reverts commit df0b9824b0
.
This commit is contained in:
parent
df0b9824b0
commit
46b65a481a
|
@ -3,6 +3,7 @@ from subprocess import CalledProcessError, check_output
|
||||||
from sys import exit
|
from sys import exit
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
INITIAL_DELAY_IN_SECONDS = 40
|
||||||
PING_INTERVAL_IN_SECONDS = 80
|
PING_INTERVAL_IN_SECONDS = 80
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +11,7 @@ class WifiKeepalive:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.defaultRoute = None
|
self.defaultRoute = None
|
||||||
|
self.initialDelay = INITIAL_DELAY_IN_SECONDS
|
||||||
self.pingInterval = PING_INTERVAL_IN_SECONDS
|
self.pingInterval = PING_INTERVAL_IN_SECONDS
|
||||||
self.isConnected = False
|
self.isConnected = False
|
||||||
self.pingCommand = 'ping -c 1 -W 2 -n'
|
self.pingCommand = 'ping -c 1 -W 2 -n'
|
||||||
|
@ -24,6 +26,7 @@ class WifiKeepalive:
|
||||||
sleep(self.pingInterval)
|
sleep(self.pingInterval)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
|
sleep(self.initialDelay)
|
||||||
self.updateDefaultWifiRoute()
|
self.updateDefaultWifiRoute()
|
||||||
|
|
||||||
if self.defaultRoute:
|
if self.defaultRoute:
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wifi Keepalive Service
|
Description=Wifi Keepalive Service
|
||||||
Wants=network-online.target
|
After=multi.user.target
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
Loading…
Reference in New Issue