| 
				
			 | 
			
			
				@@ -549,4 +549,34 @@ function count_wlan { 
			 | 
		
	
		
			
			| 
				549
			 | 
			
				549
			 | 
			
			
				     echo $ctr 
			 | 
		
	
		
			
			| 
				550
			 | 
			
				550
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				551
			 | 
			
				551
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				552
			 | 
			
			
				+function create_wifi_startup_script { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				553
			 | 
			
			
				+    systemd_file=/etc/systemd/system/wifistart.service 
			 | 
		
	
		
			
			| 
				
			 | 
			
				554
			 | 
			
			
				+    echo '[Unit]' > $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				555
			 | 
			
			
				+    echo 'Description=WifiStartup (Start wifi networking)' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				556
			 | 
			
			
				+    echo 'After=syslog.target' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				557
			 | 
			
			
				+    echo 'After=network.target' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				558
			 | 
			
			
				+    echo '' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				559
			 | 
			
			
				+    echo '[Service]' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				560
			 | 
			
			
				+    echo 'Type=simple' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				561
			 | 
			
			
				+    echo 'User=root' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				562
			 | 
			
			
				+    echo 'Group=root' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				563
			 | 
			
			
				+    echo 'WorkingDirectory=/root' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				564
			 | 
			
			
				+    echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-wifi" >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				565
			 | 
			
			
				+    echo '' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				566
			 | 
			
			
				+    echo '[Install]' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				567
			 | 
			
			
				+    echo 'WantedBy=multi-user.target' >> $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				568
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				569
			 | 
			
			
				+    systemctl enable wifistart 
			 | 
		
	
		
			
			| 
				
			 | 
			
				570
			 | 
			
			
				+    systemctl daemon-reload 
			 | 
		
	
		
			
			| 
				
			 | 
			
				571
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				572
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				573
			 | 
			
			
				+function remove_wifi_startup_script { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				574
			 | 
			
			
				+    systemd_file=/etc/systemd/system/wifistart.service 
			 | 
		
	
		
			
			| 
				
			 | 
			
				575
			 | 
			
			
				+    if [ -f $systemd_file ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				576
			 | 
			
			
				+        systemctl disable wifistart 
			 | 
		
	
		
			
			| 
				
			 | 
			
				577
			 | 
			
			
				+        systemctl daemon-reload 
			 | 
		
	
		
			
			| 
				
			 | 
			
				578
			 | 
			
			
				+        rm $systemd_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				579
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				580
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				581
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				552
			 | 
			
				582
			 | 
			
			
				 # NOTE: deliberately no exit 0 
			 |