<commit_before>#!/bin/sh
# /etc/init.d/subnodes_ap
# starts up ap0 interface
# starts up hostapd => broadcasting wireless network subnodes

NAME=subnodes_ap
DESC="Brings up wireless access point for connecting to web server running on the device."
DAEMON_PATH="/home/pi/subnodes"
DAEMONOPTS="sudo NODE_ENV=production nodemon subnode.js"

PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

	case "$1" in
		start)
			echo "Starting $NAME access point and mesh point..."
			# associate the ap0 interface to a physical devices
			# how can i grab the next avail phy device instead of hardcoding it?
			ifconfig wlan0 down
			iw wlan0 del
			iw phy phy1 interface add ap0 type __ap

			# add interfaces to the bridge
			brctl addbr br0
			brctl addif br0 bat0
			brctl addif br0 ap0

			# bring up the AP interface and give ap0 a static IP
			ifconfig ap0 10.0.0.1 netmask 255.255.255.0 up

			# bring up the brdige and assign it a static IP
			ifconfig br0 192.168.3.1 netmask 255.255.255.0 up
<commit_msg>checking for wlan1 in subnodes_ap startup script<commit_after>#!/bin/sh
# /etc/init.d/subnodes_ap
# starts up ap0 interface
# starts up hostapd => broadcasting wireless network subnodes

NAME=subnodes_ap
DESC="Brings up wireless access point for connecting to web server running on the device."
DAEMON_PATH="/home/pi/subnodes"
DAEMONOPTS="sudo NODE_ENV=production nodemon subnode.js"

PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WLAN=wlan0
PHY=phy0

	case "$1" in
		start)
			echo "Starting $NAME access point and mesh point..."
			# associate the ap0 interface to a physical devices
			# check to see if wlan1 exists; use that radio, if so
			FOUND=`grep "wlan1" /proc/net/dev`
			if  [ -n "$FOUND" ] ; then
			$WLAN=wlan1
			$PHY=phy1
			fi
			ifconfig $WLAN down
			iw $WLAN del
			iw phy $PHY interface add ap0 type __ap

			# add interfaces to the bridge
			brctl addbr br0
			brctl addif br0 bat0
			brctl addif br0 ap0

			# bring up the AP interface and give ap0 a static IP
			ifconfig ap0 10.0.0.1 netmask 255.255.255.0 up

			# bring up the brdige and assign it a static IP
			ifconfig br0 192.168.3.1 netmask 255.255.255.0 up

{'fraction_non_alphanumeric': 0.0783132530120482, 'fraction_numerical': 0.04633920296570899, 'mean_word_length': 3.406122448979592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4296015', 'n_tokens_mistral': 874, 'n_tokens_neox': 729, 'n_words': 278}