-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Aug 16, 2014
1 parent
9554ae7
commit fdaab9b
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Wifi Startup Retry | ||
|
||
[Service] | ||
WorkingDirectory=/home/root/wifiboot/ | ||
ExecStart=/home/root/wifiboot/wifiboot.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cp wifiboot.service /lib/systemd/system/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sat Nov 30 04:27:32 2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import subprocess | ||
import time | ||
|
||
host = "yahoo.com" | ||
|
||
while True: | ||
ping = subprocess.Popen( | ||
["ping", "-c", "2", host], | ||
stdout = subprocess.PIPE, | ||
stderr = subprocess.PIPE | ||
) | ||
|
||
out, error = ping.communicate() | ||
|
||
|
||
print out | ||
import re | ||
matcher = re.search(r"(\d) packets transmitted, (\d) received",out) | ||
if(matcher): | ||
print matcher.group(1) | ||
print matcher.group(2) | ||
|
||
sent = matcher.group(1) | ||
received = matcher.group(2) | ||
|
||
if(sent == received): | ||
time_now = time.asctime(time.localtime()) | ||
print time_now | ||
f = open('last_ping.txt','w') | ||
f.write(time_now) | ||
f.close() | ||
|
||
time.sleep(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Wifi Startup Retry | ||
|
||
[Service] | ||
WorkingDirectory=/home/root/wifiboot/ | ||
ExecStart=/home/root/wifiboot/wifiboot.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh - | ||
sleep 10 | ||
#systemctl restart connman.service | ||
|
||
#python ping_test.py >/dev/null & | ||
|
||
cd /home/root/halo_git/ | ||
|
||
./Halo_Master.pl > /dev/null & | ||
|
||
cd /home/root/colorpicker-beaglebone/ | ||
|
||
NODE_ENV=production npm start | ||
|