wifi utils static analysis

This commit is contained in:
Bob Mottram 2018-03-02 20:07:54 +00:00
parent f13c18092f
commit c44d07bd2f
2 changed files with 128 additions and 132 deletions

View File

@ -112,7 +112,6 @@ function syncthing_add_id {
syncthing_create_ids_file syncthing_create_ids_file
data=$(mktemp 2>/dev/null) data=$(mktemp 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone User Control Panel" \ dialog --backtitle $"Freedombone User Control Panel" \
--title $"Add a Syncthing device ID" \ --title $"Add a Syncthing device ID" \
--form $"Paste the device ID for your laptop/desktop/netbook/phone/tablet below" 9 80 2 \ --form $"Paste the device ID for your laptop/desktop/netbook/phone/tablet below" 9 80 2 \

View File

@ -74,10 +74,10 @@ function wifi_static_network_interface {
else else
read_config_param "LOCAL_NETWORK_STATIC_IP_ADDRESS" read_config_param "LOCAL_NETWORK_STATIC_IP_ADDRESS"
read_config_param "ROUTER_IP_ADDRESS" read_config_param "ROUTER_IP_ADDRESS"
echo 'iface default inet static' > /etc/network/interfaces.d/static { echo 'iface default inet static';
echo " address ${LOCAL_NETWORK_STATIC_IP_ADDRESS}" >> /etc/network/interfaces.d/static echo " address ${LOCAL_NETWORK_STATIC_IP_ADDRESS}";
echo ' netmask 255.255.255.0' >> /etc/network/interfaces.d/static echo ' netmask 255.255.255.0';
echo " gateway ${ROUTER_IP_ADDRESS}" >> /etc/network/interfaces.d/static echo " gateway ${ROUTER_IP_ADDRESS}"; } > /etc/network/interfaces.d/static
fi fi
} }
@ -98,14 +98,14 @@ function setup_wifi_atheros {
else else
atheros_drivers_file=$(pwd)/$atheros_drivers_file atheros_drivers_file=$(pwd)/$atheros_drivers_file
fi fi
dpkg -i $atheros_drivers_file dpkg -i "$atheros_drivers_file"
reset_usb_devices reset_usb_devices
update_wifi_adaptors update_wifi_adaptors
if [ $IFACE ]; then if [ "$IFACE" ]; then
wpa_action ${IFACE} stop wpa_action "${IFACE}" stop
wpa_cli -i ${IFACE} terminate wpa_cli -i "${IFACE}" terminate
#ifconfig $IFACE up #ifconfig $IFACE up
ifup $IFACE ifup "$IFACE"
fi fi
} }
@ -129,8 +129,8 @@ function setup_wifi {
HOTSPOT='yes' HOTSPOT='yes'
fi fi
if [ -f $WIFI_NETWORKS_FILE ]; then if [ -f "$WIFI_NETWORKS_FILE" ]; then
${PROJECT_NAME}-wifi --networks $WIFI_NETWORKS_FILE "${PROJECT_NAME}-wifi" --networks "$WIFI_NETWORKS_FILE"
mark_complete "${FUNCNAME[0]}" mark_complete "${FUNCNAME[0]}"
return return
fi fi
@ -144,9 +144,9 @@ function setup_wifi {
echo $'Wifi passphrase was too short' echo $'Wifi passphrase was too short'
return return
fi fi
${PROJECT_NAME}-wifi -s $WIFI_SSID -t $WIFI_TYPE -p $WIFI_PASSPHRASE --hotspot $HOTSPOT --networks $WIFI_NETWORKS_FILE "${PROJECT_NAME}-wifi" -s "$WIFI_SSID" -t "$WIFI_TYPE" -p "$WIFI_PASSPHRASE" --hotspot "$HOTSPOT" --networks "$WIFI_NETWORKS_FILE"
else else
${PROJECT_NAME}-wifi -s $WIFI_SSID -t $WIFI_TYPE --hotspot $HOTSPOT --networks $WIFI_NETWORKS_FILE "${PROJECT_NAME}-wifi" -s "$WIFI_SSID" -t "$WIFI_TYPE" --hotspot "$HOTSPOT" --networks "$WIFI_NETWORKS_FILE"
fi fi
mark_completed "${FUNCNAME[0]}" mark_completed "${FUNCNAME[0]}"
} }
@ -156,13 +156,13 @@ function install_atheros_wifi {
if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
return return
fi fi
if [ $INSTALLING_ON_BBB != "yes" ]; then if [ "$INSTALLING_ON_BBB" != "yes" ]; then
return return
fi fi
if [[ $ENABLE_BATMAN != "yes" ]]; then if [[ $ENABLE_BATMAN != "yes" ]]; then
return return
fi fi
if [ -d $INSTALL_DIR/open-ath9k-htc-firmware ]; then if [ -d "$INSTALL_DIR/open-ath9k-htc-firmware" ]; then
return return
fi fi
# have drivers already been installed ? # have drivers already been installed ?
@ -170,32 +170,28 @@ function install_atheros_wifi {
return return
fi fi
apt-get -yq install build-essential cmake git m4 texinfo apt-get -yq install build-essential cmake git m4 texinfo
if [ ! -d $INSTALL_DIR ]; then if [ ! -d "$INSTALL_DIR" ]; then
mkdir -p $INSTALL_DIR mkdir -p "$INSTALL_DIR"
fi fi
cd $INSTALL_DIR cd "$INSTALL_DIR" || exit 24678246
if [ ! -d $INSTALL_DIR/open-ath9k-htc-firmware ]; then if [ ! -d "$INSTALL_DIR/open-ath9k-htc-firmware" ]; then
function_check git_clone function_check git_clone
git_clone $ATHEROS_WIFI_REPO $INSTALL_DIR/open-ath9k-htc-firmware if ! git_clone "$ATHEROS_WIFI_REPO" "$INSTALL_DIR/open-ath9k-htc-firmware"; then
if [ ! "$?" = "0" ]; then rm -rf "$INSTALL_DIR/open-ath9k-htc-firmware"
rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
exit 74283 exit 74283
fi fi
fi fi
cd $INSTALL_DIR/open-ath9k-htc-firmware cd "$INSTALL_DIR/open-ath9k-htc-firmware" || exit 24682468
git checkout 1.4.0 git checkout 1.4.0
make toolchain if ! make toolchain; then
if [ ! "$?" = "0" ]; then rm -rf "$INSTALL_DIR/open-ath9k-htc-firmware"
rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
exit 24820 exit 24820
fi fi
make firmware if ! make firmware; then
if [ ! "$?" = "0" ]; then rm -rf "$INSTALL_DIR/open-ath9k-htc-firmware"
rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
exit 63412 exit 63412
fi fi
cp target_firmware/*.fw /lib/firmware/ if ! cp target_firmware/*.fw /lib/firmware/; then
if [ ! "$?" = "0" ]; then
exit 74681 exit 74681
fi fi
mark_completed "${FUNCNAME[0]}" mark_completed "${FUNCNAME[0]}"
@ -206,7 +202,7 @@ function update_wifi_adaptors {
IFACE_SECONDARY= IFACE_SECONDARY=
for i in $(seq 10 -1 0); do for i in $(seq 10 -1 0); do
ifdown --force wlan${i} 2> /dev/null ifdown --force "wlan${i}" 2> /dev/null
done done
for i in $(seq 10 -1 0); do for i in $(seq 10 -1 0); do
@ -226,7 +222,7 @@ function wifi_get_psk {
passphrase=$2 passphrase=$2
psk=$(wpa_passphrase "$ssid" "$passphrase" | grep 'psk=' | sed -n 2p | awk -F '=' '{print $2}') psk=$(wpa_passphrase "$ssid" "$passphrase" | grep 'psk=' | sed -n 2p | awk -F '=' '{print $2}')
echo $psk echo "$psk"
} }
function hotspot_off { function hotspot_off {
@ -274,34 +270,34 @@ function hotspot_on {
sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
echo '### Wireless network name ###' > /etc/hostapd/hostapd.conf { echo '### Wireless network name ###';
echo "interface=$WIFI_INTERFACE" >> /etc/hostapd/hostapd.conf echo "interface=$WIFI_INTERFACE";
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo '### Set your bridge name ###' >> /etc/hostapd/hostapd.conf echo '### Set your bridge name ###';
echo 'bridge=br0' >> /etc/hostapd/hostapd.conf echo 'bridge=br0';
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf echo 'driver=nl80211';
echo "country_code=UK" >> /etc/hostapd/hostapd.conf echo "country_code=UK";
echo "ssid=$WIFI_SSID" >> /etc/hostapd/hostapd.conf echo "ssid=$WIFI_SSID";
echo 'hw_mode=g' >> /etc/hostapd/hostapd.conf echo 'hw_mode=g';
echo 'channel=6' >> /etc/hostapd/hostapd.conf echo 'channel=6';
echo 'wpa=2' >> /etc/hostapd/hostapd.conf echo 'wpa=2';
echo "wpa_passphrase=$WIFI_PASSPHRASE" >> /etc/hostapd/hostapd.conf echo "wpa_passphrase=$WIFI_PASSPHRASE";
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo '## Key management algorithms ##' >> /etc/hostapd/hostapd.conf echo '## Key management algorithms ##';
echo 'wpa_key_mgmt=WPA-PSK' >> /etc/hostapd/hostapd.conf echo 'wpa_key_mgmt=WPA-PSK';
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo '## Set cipher suites (encryption algorithms) ##' >> /etc/hostapd/hostapd.conf echo '## Set cipher suites (encryption algorithms) ##';
echo '## TKIP = Temporal Key Integrity Protocol' >> /etc/hostapd/hostapd.conf echo '## TKIP = Temporal Key Integrity Protocol';
echo '## CCMP = AES in Counter mode with CBC-MAC' >> /etc/hostapd/hostapd.conf echo '## CCMP = AES in Counter mode with CBC-MAC';
echo 'wpa_pairwise=TKIP' >> /etc/hostapd/hostapd.conf echo 'wpa_pairwise=TKIP';
echo 'rsn_pairwise=CCMP' >> /etc/hostapd/hostapd.conf echo 'rsn_pairwise=CCMP';
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo '## Shared Key Authentication ##' echo '## Shared Key Authentication ##'
echo 'auth_algs=1' >> /etc/hostapd/hostapd.conf echo 'auth_algs=1';
echo '' >> /etc/hostapd/hostapd.conf echo '';
echo '## Accept all MAC address ###' >> /etc/hostapd/hostapd.conf echo '## Accept all MAC address ###';
echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf echo 'macaddr_acl=0'; } > /etc/hostapd/hostapd.conf
if [ ! -f /etc/network/interfaces_original_static ]; then if [ ! -f /etc/network/interfaces_original_static ]; then
if [ -f /etc/network/interfaces.d/static ]; then if [ -f /etc/network/interfaces.d/static ]; then
@ -365,7 +361,7 @@ function wifi_wpa2_psk {
echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces.d/wifi echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces.d/wifi
wifi_static_network_interface wifi_static_network_interface
wpa_passphrase "$ssid" "$passphrase" > $WIFI_CONFIG wpa_passphrase "$ssid" "$passphrase" > "$WIFI_CONFIG"
systemctl restart network-manager systemctl restart network-manager
ifup $WIFI_INTERFACE ifup $WIFI_INTERFACE
@ -385,24 +381,23 @@ function wifi_none {
wifi_static_network_interface wifi_static_network_interface
echo 'ctrl_interface=/run/wpa_supplicant' > $WIFI_CONFIG { echo 'ctrl_interface=/run/wpa_supplicant';
echo 'update_config=1' >> $WIFI_CONFIG echo 'update_config=1';
echo 'eapol_version=1' >> $WIFI_CONFIG echo 'eapol_version=1';
echo '' >> $WIFI_CONFIG echo '';
echo 'network={'; } > "$WIFI_CONFIG"
echo 'network={' >> $WIFI_CONFIG
if [[ "${ssid}" != $'any' && "${ssid}" != $'all' && "${ssid}" != $'open' ]]; then if [[ "${ssid}" != $'any' && "${ssid}" != $'all' && "${ssid}" != $'open' ]]; then
echo " ssid=\"${ssid}\"" >> $WIFI_CONFIG echo " ssid=\"${ssid}\"" >> "$WIFI_CONFIG"
fi fi
echo ' key_mgmt=NONE' >> $WIFI_CONFIG echo ' key_mgmt=NONE' >> "$WIFI_CONFIG"
echo '}' >> $WIFI_CONFIG echo '}' >> "$WIFI_CONFIG"
systemctl restart network-manager systemctl restart network-manager
ifup $WIFI_INTERFACE ifup $WIFI_INTERFACE
} }
function networks_from_file { function networks_from_file {
if [ ! -f $WIFI_NETWORKS_FILE ]; then if [ ! -f "$WIFI_NETWORKS_FILE" ]; then
exit 4 exit 4
fi fi
@ -416,21 +411,21 @@ function networks_from_file {
echo 'allow-hotplug eth0' > /etc/network/interfaces.d/static echo 'allow-hotplug eth0' > /etc/network/interfaces.d/static
echo 'iface eth0 inet dhcp' >> /etc/network/interfaces.d/static echo 'iface eth0 inet dhcp' >> /etc/network/interfaces.d/static
echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces.d/wifi { echo "allow-hotplug ${WIFI_INTERFACE}";
echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces.d/wifi echo "iface ${WIFI_INTERFACE} inet manual";
echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces.d/wifi echo " wpa-roam $WIFI_CONFIG"; } > /etc/network/interfaces.d/wifi
wifi_static_network_interface wifi_static_network_interface
# remove wpa_supplicant.conf if it exists # remove wpa_supplicant.conf if it exists
if [ -f $WIFI_CONFIG ]; then if [ -f "$WIFI_CONFIG" ]; then
rm -f $WIFI_CONFIG rm -f "$WIFI_CONFIG"
fi fi
echo 'ctrl_interface=/run/wpa_supplicant' > $WIFI_CONFIG { echo 'ctrl_interface=/run/wpa_supplicant';
echo 'update_config=1' >> $WIFI_CONFIG echo 'update_config=1';
echo 'eapol_version=1' >> $WIFI_CONFIG echo 'eapol_version=1';
echo '' >> $WIFI_CONFIG echo ''; } > "$WIFI_CONFIG"
ctr=0 ctr=0
while read -r line while read -r line
@ -443,19 +438,19 @@ function networks_from_file {
if [ $ctr -eq 1 ]; then if [ $ctr -eq 1 ]; then
WIFI_TYPE="$line" WIFI_TYPE="$line"
if [[ $WIFI_TYPE == $'none' || $WIFI_TYPE == $'open' ]]; then if [[ $WIFI_TYPE == $'none' || $WIFI_TYPE == $'open' ]]; then
echo 'network={' >> $WIFI_CONFIG echo 'network={' >> "$WIFI_CONFIG"
if [[ "${WIFI_SSID}" != $'any' && "${WIFI_SSID}" != $'all' && "${WIFI_SSID}" != $'open' ]]; then if [[ "${WIFI_SSID}" != $'any' && "${WIFI_SSID}" != $'all' && "${WIFI_SSID}" != $'open' ]]; then
echo " ssid=\"${WIFI_SSID}\"" >> $WIFI_CONFIG echo " ssid=\"${WIFI_SSID}\"" >> "$WIFI_CONFIG"
fi fi
echo ' key_mgmt=NONE' >> $WIFI_CONFIG echo ' key_mgmt=NONE' >> "$WIFI_CONFIG"
echo '}' >> $WIFI_CONFIG echo '}' >> "$WIFI_CONFIG"
ctr=0 ctr=0
continue continue
fi fi
fi fi
if [ $ctr -eq 2 ]; then if [ $ctr -eq 2 ]; then
WIFI_PASSPHRASE="$line" WIFI_PASSPHRASE="$line"
wpa_passphrase "$WIFI_SSID" "$WIFI_PASSPHRASE" >> $WIFI_CONFIG wpa_passphrase "$WIFI_SSID" "$WIFI_PASSPHRASE" >> "$WIFI_CONFIG"
ctr=0 ctr=0
continue continue
fi fi
@ -463,7 +458,7 @@ function networks_from_file {
ctr=$((ctr + 1)) ctr=$((ctr + 1))
fi fi
fi fi
done < $WIFI_NETWORKS_FILE done < "$WIFI_NETWORKS_FILE"
systemctl restart network-manager systemctl restart network-manager
#ifconfig ${WIFI_INTERFACE} up #ifconfig ${WIFI_INTERFACE} up
@ -471,27 +466,27 @@ function networks_from_file {
} }
function wifi_networks_file_header { function wifi_networks_file_header {
echo $'# Add wifi networks as follows:' > $WIFI_NETWORKS_FILE { echo $'# Add wifi networks as follows:';
echo '#' >> $WIFI_NETWORKS_FILE echo '#';
echo $'# MySSID' >> $WIFI_NETWORKS_FILE echo $'# MySSID';
echo $'# wpa2-psk' >> $WIFI_NETWORKS_FILE echo $'# wpa2-psk';
echo $'# myWifiPassphrase' >> $WIFI_NETWORKS_FILE echo $'# myWifiPassphrase';
echo '#' >> $WIFI_NETWORKS_FILE echo '#';
echo $'# AnotherSSID' >> $WIFI_NETWORKS_FILE echo $'# AnotherSSID';
echo $'# none' >> $WIFI_NETWORKS_FILE echo $'# none';
echo '#' >> $WIFI_NETWORKS_FILE echo '#'; } > "$WIFI_NETWORKS_FILE"
} }
function create_networks_interactive { function create_networks_interactive {
remove_config_param "WIFI_INTERFACE" remove_config_param "WIFI_INTERFACE"
update_wifi_adaptors update_wifi_adaptors
if [ ! $IFACE ]; then if [ ! "$IFACE" ]; then
# Don't try to configure wifi if there are no adaptors # Don't try to configure wifi if there are no adaptors
return return
fi fi
if [ -f $WIFI_NETWORKS_FILE ]; then if [ -f "$WIFI_NETWORKS_FILE" ]; then
rm $WIFI_NETWORKS_FILE rm "$WIFI_NETWORKS_FILE"
fi fi
# By default connect to any open wifi # By default connect to any open wifi
@ -503,11 +498,10 @@ function create_networks_interactive {
wifi_settings_defined= wifi_settings_defined=
while [ ! $wifi_networks_done ] while [ ! $wifi_networks_done ]
do do
data=$(tempfile 2>/dev/null) data=$(mktemp 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 wifistr=$"\\nTo use this system via wifi (eg. USB dongle) enter the details below, otherwise just select Ok:"
wifistr=$"\nTo use this system via wifi (eg. USB dongle) enter the details below, otherwise just select Ok:"
if [ -f /root/.wifi-only ]; then if [ -f /root/.wifi-only ]; then
wifistr=$"\nEnter your wifi login details below." wifistr=$"\\nEnter your wifi login details below."
fi fi
dialog --backtitle $"Freedombone Configuration" \ dialog --backtitle $"Freedombone Configuration" \
--title $"Wifi Settings ${wifi_ctr}" \ --title $"Wifi Settings ${wifi_ctr}" \
@ -515,15 +509,18 @@ function create_networks_interactive {
$"SSID (can be 'any'):" 1 1 "$WIFI_SSID" 1 24 30 30 \ $"SSID (can be 'any'):" 1 1 "$WIFI_SSID" 1 24 30 30 \
$"Type (open/wpa2-psk):" 2 1 "$WIFI_TYPE" 2 24 10 10 \ $"Type (open/wpa2-psk):" 2 1 "$WIFI_TYPE" 2 24 10 10 \
$"Passphrase:" 3 1 "$WIFI_PASSPHRASE" 3 24 50 50 \ $"Passphrase:" 3 1 "$WIFI_PASSPHRASE" 3 24 50 50 \
2> $data 2> "$data"
sel=$? sel=$?
case $sel in case $sel in
1) return;; 1) rm -f "$data"
255) return;; return;;
255) rm -f "$data"
return;;
esac esac
WIFI_SSID=$(cat $data | sed -n 1p) WIFI_SSID=$(sed -n 1p < "$data")
WIFI_TYPE=$(cat $data | sed -n 2p) WIFI_TYPE=$(sed -n 2p < "$data")
WIFI_PASSPHRASE=$(cat $data | sed -n 3p) WIFI_PASSPHRASE=$(sed -n 3p < "$data")
rm -f "$data"
# If the wifi-only indicator is present then wifi details must # If the wifi-only indicator is present then wifi details must
# be specified, otherwise they're optional # be specified, otherwise they're optional
@ -539,16 +536,16 @@ function create_networks_interactive {
fi fi
fi fi
if [ ! -f $WIFI_NETWORKS_FILE ]; then if [ ! -f "$WIFI_NETWORKS_FILE" ]; then
wifi_networks_file_header wifi_networks_file_header
fi fi
# update the wifi networks file # update the wifi networks file
echo '' >> $WIFI_NETWORKS_FILE { echo '';
echo "$WIFI_SSID" >> $WIFI_NETWORKS_FILE echo "$WIFI_SSID";
echo "$WIFI_TYPE" >> $WIFI_NETWORKS_FILE echo "$WIFI_TYPE"; } >> "$WIFI_NETWORKS_FILE"
if [ ${#WIFI_PASSPHRASE} -gt 1 ]; then if [ ${#WIFI_PASSPHRASE} -gt 1 ]; then
echo "$WIFI_PASSPHRASE" >> $WIFI_NETWORKS_FILE echo "$WIFI_PASSPHRASE" >> "$WIFI_NETWORKS_FILE"
fi fi
if [ ${#WIFI_SSID} -gt 1 ]; then if [ ${#WIFI_SSID} -gt 1 ]; then
@ -626,28 +623,28 @@ function remove_wifi_startup_script {
systemctl disable wifistart systemctl disable wifistart
rm $systemd_file rm $systemd_file
fi fi
if [ -f $HOME/${PROJECT_NAME}-wifi.cfg ]; then if [ -f "$HOME/${PROJECT_NAME}-wifi.cfg" ]; then
rm $HOME/${PROJECT_NAME}-wifi.cfg rm "$HOME/${PROJECT_NAME}-wifi.cfg"
fi fi
} }
function create_wifi_startup_script { function create_wifi_startup_script {
systemd_file=/etc/systemd/system/wifistart.service systemd_file=/etc/systemd/system/wifistart.service
echo '[Unit]' > $systemd_file { echo '[Unit]';
echo 'Description=WifiStartup (Start wifi networking)' >> $systemd_file echo 'Description=WifiStartup (Start wifi networking)';
echo 'After=syslog.target' >> $systemd_file echo 'After=syslog.target';
echo 'After=network.target' >> $systemd_file echo 'After=network.target';
echo 'After=remote-fs.target' >> $systemd_file echo 'After=remote-fs.target';
echo '' >> $systemd_file echo '';
echo '[Service]' >> $systemd_file echo '[Service]';
echo 'Type=simple' >> $systemd_file echo 'Type=simple';
echo 'User=root' >> $systemd_file echo 'User=root';
echo 'Group=root' >> $systemd_file echo 'Group=root';
echo 'WorkingDirectory=/root' >> $systemd_file echo 'WorkingDirectory=/root';
echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-wifi --wait 5 2> /dev/null" >> $systemd_file echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-wifi --wait 5 2> /dev/null";
echo '' >> $systemd_file echo '';
echo '[Install]' >> $systemd_file echo '[Install]';
echo 'WantedBy=multi-user.target' >> $systemd_file echo 'WantedBy=multi-user.target'; } > $systemd_file
systemctl enable wifistart systemctl enable wifistart
systemctl daemon-reload systemctl daemon-reload