-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
145 changed files
with
12,817 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,35 @@ | ||
[connection] | ||
id=hotspot | ||
uuid=c9566ab4-ab8c-47aa-aa5b-0060ea58c5af | ||
type=wifi | ||
interface-name=wlan0 | ||
permissions= | ||
secondaries= | ||
timestamp=1472130453 | ||
|
||
[wifi] | ||
band=bg | ||
channel=3 | ||
mac-address={MAC_ADDRESS} | ||
mac-address-blacklist= | ||
mac-address-randomization=0 | ||
mode=ap | ||
seen-bssids=E0:76:D0:59:0D:40; | ||
ssid=CS1P-35 | ||
|
||
[wifi-security] | ||
group= | ||
key-mgmt=wpa-psk | ||
pairwise= | ||
proto= | ||
psk=12345678 | ||
|
||
[ipv4] | ||
dns-search= | ||
method=shared | ||
|
||
[ipv6] | ||
addr-gen-mode=stable-privacy | ||
dns-search= | ||
ip6-privacy=0 | ||
method=ignore |
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,194 @@ | ||
#!/usr/bin/tclsh | ||
|
||
|
||
proc runOOBEScripts {} { | ||
puts "-I- running OOBE scripts" | ||
set services [lsort [glob -directory /intel/euclid/oobe-services/ros_services/ S*/init.sh]] | ||
set i 0 | ||
foreach service $services { | ||
puts "-I- running service: $service" | ||
if { [catch {exec $service &} err ] } { | ||
puts "Error running: $service, error: $err" | ||
} | ||
if {$i ==0} { | ||
incr i | ||
exec sleep 5 | ||
} | ||
|
||
exec sleep 1 | ||
} | ||
puts "-I- Done running OOBE scripts" | ||
|
||
} | ||
|
||
proc stopOOBEScripts {} { | ||
if { [catch {exec /intel/euclid/oobe-services/ros_services/stop_ros.bash} err ] } { | ||
puts "Error: $err" | ||
} else { | ||
puts "no error" | ||
} | ||
} | ||
|
||
proc runStartupScripts { {fast false} } { | ||
puts "-I- Running startup scripts" | ||
set services [lsort [glob -directory /intel/euclid/oobe-services/startup_services/ S*/init.sh]] | ||
set i 0 | ||
foreach service $services { | ||
puts "-I- running service: $service" | ||
|
||
if {[regexp {Network} $service] } { | ||
if { [catch {exec $service $fast } err ] } { | ||
puts "Error running: $service, error: $err" | ||
} | ||
} else { | ||
if { [catch {exec $service & } err ] } { | ||
puts "Error running: $service, error: $err" | ||
} | ||
} | ||
incr i | ||
exec sleep 1 | ||
} | ||
puts "-I- Done running startup scripts" | ||
} | ||
|
||
proc runSafeMode { } { | ||
puts "-I- Running scripts in safe mode" | ||
if { [catch {exec /intel/euclid/oobe-services/startup_services/S2WebServer/stop.sh &} err ] } { | ||
puts "Error: $err" | ||
} else { | ||
puts "no error" | ||
} | ||
|
||
if { [catch {exec /intel/euclid/oobe-services/startup_services/S2WebServer/init.sh True &} err ] } { | ||
puts "Error: $err" | ||
} else { | ||
puts "no error" | ||
} | ||
puts "-I- Done running scripts in safe mode " | ||
} | ||
|
||
proc exitSafeMode { } { | ||
puts "-I- Exiting scripts in safe mode" | ||
if { [catch {exec /intel/euclid/oobe-services/startup_services/S2WebServer/stop.sh &} err ] } { | ||
puts "Error: $err" | ||
} else { | ||
puts "no error" | ||
} | ||
|
||
if { [catch {exec /intel/euclid/oobe-services/startup_services/S2WebServer/init.sh &} err ] } { | ||
puts "Error: $err" | ||
} else { | ||
puts "no error" | ||
} | ||
puts "-I- Done Exiting scripts in safe mode " | ||
} | ||
|
||
proc runMonitorScripts { {fast false} } { | ||
puts "-I- Running Mon scripts" | ||
set services [lsort [glob -directory /intel/euclid/oobe-services/monitor_services/ S*/init.sh]] | ||
set i 0 | ||
foreach service $services { | ||
puts "-I- running service: $service" | ||
|
||
if { [catch {exec $service & } err ] } { | ||
puts "Error running: $service, error: $err" | ||
} | ||
|
||
incr i | ||
exec sleep 1 | ||
} | ||
puts "-I- Done running monitor scripts" | ||
} | ||
|
||
proc stopMonitorScripts {} { | ||
|
||
set services [lsort [glob -directory /intel/euclid/oobe-services/monitor_services/ S*/stop.sh]] | ||
set i 0 | ||
foreach service $services { | ||
puts "Stopping service: $service" | ||
if { [catch {exec $service } err ] } { | ||
puts "Error stopping: $service, error: $err" | ||
} | ||
|
||
#exec sleep 1 | ||
} | ||
|
||
puts "Done stopping service" | ||
} | ||
|
||
proc stopStartupScripts {} { | ||
|
||
set services [lsort [glob -directory /intel/euclid/oobe-services/startup_services/ S*/stop.sh]] | ||
set i 0 | ||
foreach service $services { | ||
puts "Stopping service: $service" | ||
if { [catch {exec $service } err ] } { | ||
puts "Error stopping: $service, error: $err" | ||
} | ||
|
||
#exec sleep 1 | ||
} | ||
if { [catch {exec /intel/euclid/oobe-services/startup_services/stop_scripts.bash } err ] } { | ||
puts "Error stopping: $err" | ||
} | ||
puts "Done stopping service" | ||
|
||
|
||
} | ||
|
||
if { [string equal [lindex $argv 0] "restart-oobe" ] } { | ||
puts "Stopping .." | ||
stopOOBEScripts | ||
puts "Stoping startup" | ||
stopStartupScripts | ||
puts "Stoping monitor" | ||
stopMonitorScripts | ||
puts "Running startup" | ||
runStartupScripts true | ||
puts "Running monitor scripts" | ||
runMonitorScripts | ||
puts "Running oobe" | ||
runOOBEScripts | ||
} elseif { [string equal [lindex $argv 0] "restart-live-net" ] } { | ||
puts "** calling restart-live-net **" | ||
puts "Stopping oobe scripts" | ||
stopOOBEScripts | ||
puts "Stoping startup" | ||
stopStartupScripts | ||
puts "Running startup" | ||
runStartupScripts false | ||
puts "Running oobe" | ||
runOOBEScripts | ||
} elseif { [string equal [lindex $argv 0] "stop-oobe-live-net" ] } { | ||
puts "** calling stop-oobe-with-live-net **" | ||
stopOOBEScripts | ||
puts "Stoping startup" | ||
stopStartupScripts | ||
} elseif { [string equal [lindex $argv 0] "start-oobe-live-net" ] } { | ||
runStartupScripts | ||
runOOBEScripts | ||
} elseif { [string equal [lindex $argv 0] "start-safe-mode" ] } { | ||
runSafeMode | ||
} elseif { [string equal [lindex $argv 0] "exit-safe-mode" ] } { | ||
exitSafeMode | ||
} elseif { [string equal [lindex $argv 0] "stop" ] } { | ||
puts "Stopping" | ||
stopOOBEScripts | ||
stopStartupScripts | ||
stopMonitorScripts | ||
} elseif { [string equal [lindex $argv 0] "start" ] } { | ||
runStartupScripts | ||
runMonitorScripts | ||
runOOBEScripts | ||
} elseif { [string equal [lindex $argv 0] "stop-oobe" ] } { | ||
stopOOBEScripts | ||
stopStartupScripts | ||
stopMonitorScripts | ||
|
||
} else { | ||
runStartupScripts | ||
runMonitorScripts | ||
runOOBEScripts | ||
} | ||
|
||
exit 0 |
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 @@ | ||
#!/usr/bin/env python | ||
import subprocess | ||
import sys | ||
|
||
|
||
def generateHotSpot(macAddress): | ||
hotSpotTemplate = None | ||
|
||
with open('hotspot_template', 'r') as f: | ||
hotSpotTemplate = f.read() | ||
|
||
formTemplateStr = hotSpotTemplate.replace('{MAC_ADDRESS}', macAddress.strip('\n')) | ||
with open('/etc/NetworkManager/system-connections/hotspot', 'a') as f2: | ||
f2.write(formTemplateStr) | ||
f2.close() | ||
|
||
def get_mac_address(): | ||
''' | ||
Get current MAC address of wlan0 device | ||
:param req: | ||
:return: macAddress | ||
''' | ||
myMac = subprocess.Popen(["ifconfig wlan0 | head -n1 | tr -s ' ' | cut -d' ' -f5"],stdout=subprocess.PIPE, shell=True) | ||
(macAddress, errors) = myMac.communicate() | ||
myMac.stdout.close() | ||
return macAddress | ||
|
||
if __name__ == '__main__': | ||
try: | ||
macAddress = get_mac_address() | ||
generateHotSpot (macAddress) | ||
except Exception: | ||
pass |
Oops, something went wrong.