Skip to content

Commit

Permalink
Add wifiboot service files
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 16, 2014
1 parent 9554ae7 commit fdaab9b
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wifiboot.service
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
1 change: 1 addition & 0 deletions wifiboot/cp_service
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cp wifiboot.service /lib/systemd/system/
1 change: 1 addition & 0 deletions wifiboot/last_ping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sat Nov 30 04:27:32 2013
33 changes: 33 additions & 0 deletions wifiboot/ping_test.py
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)
9 changes: 9 additions & 0 deletions wifiboot/wifiboot.service
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
14 changes: 14 additions & 0 deletions wifiboot/wifiboot.sh
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

0 comments on commit fdaab9b

Please sign in to comment.