Index: scripts/bluetooth_paired_clear.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/bluetooth_paired_clear.sh (.../bluetooth_paired_clear.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/bluetooth_paired_clear.sh (.../bluetooth_paired_clear.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -19,20 +19,20 @@ # This file is called by UI Software to removed all the currnelty paired or cached devices. # This is done before each scan to clean up and start a fresh scan. -DEVICES=$(echo "devices" | bluetoothctl | grep ^Device | cut -b 8-25) +DEVICES=$(echo "devices" | sudo bluetoothctl | grep ^Device | cut -b 8-25) if [ ! -z "$DEVICES" ]; then for device in $DEVICES; do if [ ! -z "$device" ]; then - echo "remove $device" | bluetoothctl + echo "remove $device" | sudo bluetoothctl fi done fi -PAIRED_DEVICES=$(echo "paired-devices" | bluetoothctl | grep ^Device | cut -b 8-25) +PAIRED_DEVICES=$(echo "paired-devices" | sudo bluetoothctl | grep ^Device | cut -b 8-25) if [ ! -z "$PAIRED_DEVICES" ]; then for paired_device in $PAIRED_DEVICES; do if [ ! -z "$paired_device" ]; then - echo "remove $paired_device" | bluetoothctl + echo "remove $paired_device" | sudo bluetoothctl fi done fi Index: scripts/bluetooth_paired_query.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/bluetooth_paired_query.sh (.../bluetooth_paired_query.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/bluetooth_paired_query.sh (.../bluetooth_paired_query.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -24,7 +24,7 @@ #PAIRED_DEVICE_INFO="28:FF:B2:78:5B:BF BP7000" #PAIRED_DEVICE_INFO="" -PAIRED_DEVICE_INFO=$(echo "paired-devices" | bluetoothctl | grep ^Device | cut -b 8-125) +PAIRED_DEVICE_INFO=$(echo "paired-devices" | sudo bluetoothctl | grep ^Device | cut -b 8-125) echo $PAIRED_DEVICE_INFO Index: scripts/brightness_set.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/brightness_set.sh (.../brightness_set.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/brightness_set.sh (.../brightness_set.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,6 +21,6 @@ exit 0 fi -echo "$1" > /sys/class/backlight/backlight-mipi/brightness # realtime -echo "$1" > /var/lib/systemd/backlight/platform-backlight-mipi\:backlight\:backlight-mipi # preserve for reboot +echo "$1" | sudo tee /sys/class/backlight/backlight-mipi/brightness > /dev/null # realtime +echo "$1" | sudo tee /var/lib/systemd/backlight/platform-backlight-mipi\:backlight\:backlight-mipi > /dev/null # preserve for reboot Index: scripts/crypt_setup.sh =================================================================== diff -u -rb9654575709e02aecc01a01d246d7af578679387 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/crypt_setup.sh (.../crypt_setup.sh) (revision b9654575709e02aecc01a01d246d7af578679387) +++ scripts/crypt_setup.sh (.../crypt_setup.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -50,7 +50,7 @@ } function isMounted() { - if [ "$( mount | grep "$DEV_MNT" )" != "" ]; then + if [ "$( sudo mount | grep "$DEV_MNT" )" != "" ]; then echo "partition already mounted" exit $ERR_CRYPTSETUP_MOUNT_MOUNT fi @@ -65,9 +65,9 @@ function checkOutput() { if [ "$3" == "" ]; then - out=` eval "$1" 2>&1` + out=` sudo eval "$1" 2>&1` else - out=`echo $3 | eval "$1" 2>&1` + out=`echo $3 | sudo eval "$1" 2>&1` fi if [ "$?" -ne 0 ]; then echo $out Index: scripts/lockdown.sh =================================================================== diff -u -rb9654575709e02aecc01a01d246d7af578679387 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/lockdown.sh (.../lockdown.sh) (revision b9654575709e02aecc01a01d246d7af578679387) +++ scripts/lockdown.sh (.../lockdown.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -20,28 +20,118 @@ # @details # This file sets up and verifies some of the SOM security. +# Number of problems detected with security. +NUM_PROBLEMS=0 + + +############################################################################ +# Debug output (warn). +# +# Globals: +# None +# Arguments: +# $1 Start text. +# $2 The purple text. +# Outputs: +# Warning text. +############################################################################ +function debug() { + echo -en "\033[0;34mDbg: \033[0m${1}\n" +} + +############################################################################ +# Green output (info). +# +# Globals: +# None +# Arguments: +# $1 Start text. +# $2 The green text. +# Outputs: +# Info text. +############################################################################ +function info() { + echo -en "\033[0;32mInfo: \033[0m${1}\n" +} + +############################################################################ +# Purple output (warn). +# +# Globals: +# None +# Arguments: +# $1 Start text. +# $2 The purple text. +# Outputs: +# Warning text. +############################################################################ +function warn() { + echo -en "\033[0;35mWarn: \033[0m${1}\n" +} + +############################################################################ +# Red output (error). +# +# Globals: +# None +# Arguments: +# $1 Start text. +# $2 The red text. +# Outputs: +# Error text. +############################################################################ +function error() { + echo -en "\033[0;31mError: \033[0m${1}\n" +} + +############################################################################ # Does the file contain a string? if # not, add a line at end. # If $1 not in $2 then append line $3 to end. +# +# Globals: +# None +# Arguments: # $1 What to look for. # $2 File name. # $3 What to add. +# Outputs: +# None +############################################################################ function appendIfMissing() { + # q for quiet, F for regular string match, not -x because not full line. # Done as one command because this is done remotely. grep -qF $1 $2 || echo $3 >> $2 } +############################################################################ # Remove all lines that contain $1 in file $2 then append $3. +# +# Globals: +# None +# Arguments: # $1 What to look for. # $2 File name. +# Outputs: +# None +############################################################################ function removeIfFound() { sed -i /${1}/d $2 } +############################################################################ # Turn on some ssh security. +# +# Globals: +# None +# Arguments: +# None +# Outputs: +# None +############################################################################ function secureSsh() { - local fileTarget="${PWD}/../../etc/ssh/sshd_config" + local fileTarget="/etc/ssh/sshd_config" # chown -R root.denali ${fileTarget} @@ -55,41 +145,70 @@ systemctl restart system-sshd.slice } +############################################################################ # Move the customers app files to the app users home directories, # changed the owner, and set the immutable attribute. +# +# Globals: +# None +# Arguments: +# None +# Outputs: +# None +############################################################################ function moveCustomerAppFiles() { # Move the files - mv ${PWD}/cloudsync ${PWD}/../cloudsync/ - mv ${PWD}/denali ${PWD}/../denali/ + mv ~/cloudsync /home/cloud/ + mv ~/denali /home/denali/ + mv ~/scripts /home/denali/ # Change the file owners. - chown -R cloudsync.cloudsync ${PWD}/../cloudsync - chmod -R o-rwx ${PWD}/../cloudsync - chown -R denali.denali ${PWD}/../denali - chmod -R o-rwx ${PWD}/../denali + chown -R cloud.cloud /home/cloud + chmod -R o-rwx /home/cloud + chown -R denali.denali /home/denali + chmod -R o-rwx /home/denali } +############################################################################ # Set all permissions for our users that # are not root. +# +# Globals: +# None +# Arguments: +# None +# Outputs: +# None +############################################################################ function setPermissionsCustomerAppFiles() { # Make sure the the other users have no access to these directories. - chmod -R o-rwx ${PWD}/../cloudsync - chmod -R o-rwx ${PWD}/../denali + chmod -R o-rwx /home/cloud + chmod -R o-rwx /home/denali + chmod u+rx /home/denali/denali # Give read-only access to denali by making the group owner. - mkdir -p ${PWD}/../../var/configuration/CloudSync - chown -R cloudsync.denali ${PWD}/../../var/configuration/CloudSync - chmod -R g-w,g+r,o-rwx ${PWD}/../../var/configuration/CloudSync + mkdir -p /var/configuration/CloudSync + chown -R cloud.denali /var/configuration/CloudSync + chmod -R g-w,g+r,o-rwx /var/configuration/CloudSync # Give read-only access to denali by making the group owner. - mkdir -p ${PWD}/../../media/sd-card/cloudsync - chown -R cloudsync.denali ${PWD}/../../media/sd-card/cloudsync - chmod -R g-w,g+r,o-rwx ${PWD}/../../media/sd-card/cloudsync + mkdir -p /media/sd-card/cloudsync + chown -R cloud.denali /media/sd-card/cloudsync + chmod -R u+rw,g+rw,o-rwx /media/sd-card/cloudsync + # Give read-write access to denali by making it the owner. + chown -R denali.denali /media/sd-card/log + chown -R denali.denali /media/sd-card/service + # Set the immutable attribute for all of the files. - chattr -R +i ${PWD}/../cloudsync/* - chattr -R +i ${PWD}/../denali/* + chattr -R +i /home/cloud/* + chattr -R +i /home/denali/* + + # Add Denali and Cloud to other user groups as needed. + usermod -a -G video denali + usermod -a -G input denali + usermod -a -G tty denali } function main() { @@ -100,7 +219,7 @@ setPermissionsCustomerAppFiles # Turn off root login in by ssh. - secureSsh +# secureSsh } # Running the main function Index: scripts/rootsshaccess_set.sh =================================================================== diff -u -rb9654575709e02aecc01a01d246d7af578679387 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/rootsshaccess_set.sh (.../rootsshaccess_set.sh) (revision b9654575709e02aecc01a01d246d7af578679387) +++ scripts/rootsshaccess_set.sh (.../rootsshaccess_set.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -20,9 +20,9 @@ ERR_EXECUTION=201 if [ "$1" == "YES" ]; then - sed -i '/PermitRootLogin/c\PermitRootLogin yes' $SSHD_CONFIG + sudo sed -i '/PermitRootLogin/c\PermitRootLogin yes' $SSHD_CONFIG else - sed -i '/PermitRootLogin/c\PermitRootLogin no' $SSHD_CONFIG + sudo sed -i '/PermitRootLogin/c\PermitRootLogin no' $SSHD_CONFIG fi if [ $? != 0 ]; then Index: scripts/run.sh =================================================================== diff -u -rb9654575709e02aecc01a01d246d7af578679387 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/run.sh (.../run.sh) (revision b9654575709e02aecc01a01d246d7af578679387) +++ scripts/run.sh (.../run.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -20,8 +20,100 @@ HOME=/home/$(whoami) source ./globals.sh -timerStart -applicationPOST -timerEndLog +CLOUD_USER=cloud +CLOUD_HOME=/home/$CLOUD_USER +DENALI_USER=denali +DENALI_HOME=/home/$DENALI_USER +function Local_testApplicationShasum() { + # ----------------------------------------- Sha256Sum + post_log_dash " Sha256Sum " + #check the denali applicatoin checksum + SHA_ACT=$(tail -c 83 $DENALI_HOME/$DENALI_BIN | cut -c19-82) + SHA_EXP=$(head -c -83 $DENALI_HOME/$DENALI_BIN | sha256sum -b --tag | cut -c14-77) + if [ "$SHA_ACT" == "$SHA_EXP" ]; then + post_log_pass "$POSTMSG_SHASUM$POSTMSG_POSTFIX_PASSED" + else + post_log_fail "$POSTMSG_SHASUM$POSTMSG_POSTFIX_FAILED" + fi +} + + +function Local_startCloudSync() { + # ----------------------------------------- CloudSync + post_log_dash " CloudSync " + if [ -d $HOME/$CLOUDSYNC_FOLDER ]; then + # moving/ backing up the previous treatment logs so the new buff starts with fresh sequence + echo "Backing up CloudSync I/O buff" + CLOUDSYNC_PATH="$SDCARD_MNT"/"$CLOUDSYNC_FOLDER" + CLOUDSYNC_BACKUP="$CLOUDSYNC_PATH"_backup/$(timestamp)/ + mkdir -p $CLOUDSYNC_BACKUP + sudo -u $CLOUD_USER \ + mv $CLOUDSYNC_PATH/* $CLOUDSYNC_BACKUP \ + 1>> $POSTOUT 2>> $POSTERR + sudo -u $CLOUD_USER \ + rm $CLOUD_HOME/$CLOUDSYNC_FOLDER/data/* \ + 1>> $POSTOUT 2>> $POSTERR + cd $CLOUD_HOME/$CLOUDSYNC_FOLDER/ + sudo -u $CLOUD_USER \ + python3 ./cs.py start & + sleep 2 + CLOUDSYNC_STATUS="$(sudo -u $CLOUD_USER python3 ./cs.py status)" + if [ "$CLOUDSYNC_STATUS" == "$POSTMSG_CLOUDSYNC_RUNNING" ]; then + post_log_pass "$POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_PASSED" + else + post_log_fail "$POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_FAILED" + fi + post_log "$CLOUDSYNC_STATUS" + cd + else + post_log_fail "$POSTMSG_CLOUDSYNC$POSTMSG_POSTFIX_FAILED" + fi +} + + +function Local_startApplication() { + # ----------------------------------------- Denali + post_log_dash " Denali " + #launching denali application + DENALI_VERSION="$($DENALI_HOME/$DENALI_BIN -v)" + if [ -n "$DENALI_VERSION" ]; then + post_log_pass "$($DENALI_HOME/$DENALI_BIN -v)" # log UI Software version + if [ "$APPLICATION_PARAMS" == *"-E"* ]; then + # do not enclose the APPLICATION_PARAMS in "", then it becomes an + # empty parameter to the denali which is not accepted. + sudo -u $DENALI_USER \ + $DENALI_HOME/$DENALI_BIN $APPLICATION_PARAMS + else + sudo -u $DENALI_USER \ + $DENALI_HOME/$DENALI_BIN $APPLICATION_PARAMS & + fi + else + post_log_fail "Unknown Applicaion Version for $DENALI_HOME/$DENALI_BIN" + fi +} + + +function Local_applicationPOST() { + setupConsoleout + cleanupPOSTLogs + setupCANBus + setupResolved + killApplication + setupEthernet + setupSDCard + testRTC + setupWiFi + setupBluetooth + testTouchscreen + Local_testApplicationShasum + testCloudSystem + Local_startCloudSync + Local_startApplication +} + + +timerStart +Local_applicationPOST +timerEndLog Index: scripts/wifi_disconnect_network.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_disconnect_network.sh (.../wifi_disconnect_network.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_disconnect_network.sh (.../wifi_disconnect_network.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -24,12 +24,12 @@ iface=$1 # stop the wpa service -systemctl stop wpa_supplicant@"$iface".service +sudo systemctl stop wpa_supplicant@"$iface".service #remove the wpa configuration file -rm -f /etc/wpa_supplicant/wpa_supplicant-"$iface".conf +sudo rm -f /etc/wpa_supplicant/wpa_supplicant-"$iface".conf #Shutoff wifi interface -ip link set $iface down +sudo ip link set $iface down Index: scripts/wifi_generate_wpa_supplicant.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_generate_wpa_supplicant.sh (.../wifi_generate_wpa_supplicant.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_generate_wpa_supplicant.sh (.../wifi_generate_wpa_supplicant.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -25,7 +25,7 @@ password=$2 dest=$3 securityType=$4 -psk=$(wpa_passphrase "$ssid" "$password" | grep "psk=" | grep -v "#psk" | sed -nr 's/.*psk=(.*)/\1/p') +psk=$(sudo wpa_passphrase "$ssid" "$password" | grep "psk=" | grep -v "#psk" | sed -nr 's/.*psk=(.*)/\1/p') case $securityType in wpa2) echo "Security: wpa2"; @@ -41,7 +41,7 @@ scan_ssid=1 #psk=\"\" psk="$psk" -}" > $dest;; +}" | sudo tee $dest > /dev/null;; wpa) echo "Security: wpa"; echo "ctrl_interface=/var/run/wpa_supplicant @@ -52,6 +52,6 @@ ssid=\"$ssid\" #psk=\"\" psk="$psk" -}" > $dest;; +}" | sudo tee $dest > /dev/null;; esac Index: scripts/wifi_read_gateway.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_read_gateway.sh (.../wifi_read_gateway.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_read_gateway.sh (.../wifi_read_gateway.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,4 +21,4 @@ exit 0 fi -ip route show | grep "default via" +sudo ip route show | grep "default via" Index: scripts/wifi_read_ip_settings.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_read_ip_settings.sh (.../wifi_read_ip_settings.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_read_ip_settings.sh (.../wifi_read_ip_settings.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -22,4 +22,4 @@ fi iface=$1 -ifconfig $iface | grep "inet " +sudo ifconfig $iface | grep "inet " Index: scripts/wifi_read_network_info.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_read_network_info.sh (.../wifi_read_network_info.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_read_network_info.sh (.../wifi_read_network_info.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -22,5 +22,5 @@ fi iface=$1 -iwconfig wlan0 +sudo iwconfig wlan0 Index: scripts/wifi_request_auto_assigned_ip.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_request_auto_assigned_ip.sh (.../wifi_request_auto_assigned_ip.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_request_auto_assigned_ip.sh (.../wifi_request_auto_assigned_ip.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -22,5 +22,5 @@ fi iface=$1 -killall udhcpc -udhcpc --timeout=5 --retries=1 -n -i $iface +sudo killall udhcpc +sudo udhcpc --timeout=5 --retries=1 -n -i $iface Index: scripts/wifi_reset_adapter.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_reset_adapter.sh (.../wifi_reset_adapter.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_reset_adapter.sh (.../wifi_reset_adapter.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,5 +21,5 @@ exit 0 fi -rfkill block wifi -rfkill unblock wifi +sudo rfkill block wifi +sudo rfkill unblock wifi Index: scripts/wifi_reset_interface.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_reset_interface.sh (.../wifi_reset_interface.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_reset_interface.sh (.../wifi_reset_interface.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,5 +21,5 @@ exit 0 fi -ip link set $1 down -ip link set $1 up +sudo ip link set $1 down +sudo ip link set $1 up Index: scripts/wifi_save_dhcp_interface.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_save_dhcp_interface.sh (.../wifi_save_dhcp_interface.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_save_dhcp_interface.sh (.../wifi_save_dhcp_interface.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -23,6 +23,6 @@ iface=$1 echo "auto $iface -iface $iface inet dhcp +sudo iface $iface inet dhcp wpa-driver wext - wpa-conf /etc/wpa_supplicant.conf" > /etc/network/interfaces + wpa-conf /etc/wpa_supplicant.conf" | sudo tee /etc/network/interfaces > /dev/null Index: scripts/wifi_save_static_interface_assignments.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_save_static_interface_assignments.sh (.../wifi_save_static_interface_assignments.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_save_static_interface_assignments.sh (.../wifi_save_static_interface_assignments.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -30,6 +30,6 @@ iface $iface inet static address $ip netmask $subnet_mask - gateway $3" > /etc/network/interfaces + gateway $3" | sudo tee /etc/network/interfaces > /dev/null ./wifi_set_gateway.sh $gateway Index: scripts/wifi_scan_for_networks.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_scan_for_networks.sh (.../wifi_scan_for_networks.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_scan_for_networks.sh (.../wifi_scan_for_networks.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,4 +21,4 @@ exit 0 fi -iwlist $1 scan +sudo iwlist $1 scan Index: scripts/wifi_set_auto_assigned_ip.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_set_auto_assigned_ip.sh (.../wifi_set_auto_assigned_ip.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_set_auto_assigned_ip.sh (.../wifi_set_auto_assigned_ip.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -24,4 +24,4 @@ iface=$1 echo "auto $iface -iface $iface inet dhcp" >> /etc/network/interfaces +iface $iface inet dhcp" | sudo tee -a /etc/network/interfaces > /dev/null Index: scripts/wifi_set_dns.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_set_dns.sh (.../wifi_set_dns.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_set_dns.sh (.../wifi_set_dns.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,4 +21,4 @@ exit 0 fi -echo "nameserver $1" >> /etc/resolv.conf +echo "nameserver $1" | sudo tee -a /etc/resolv.conf > /dev/null Index: scripts/wifi_set_gateway.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_set_gateway.sh (.../wifi_set_gateway.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_set_gateway.sh (.../wifi_set_gateway.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,5 +21,5 @@ exit 0 fi -ip route del default -ip route add default via $1 +sudo ip route del default +sudo ip route add default via $1 Index: scripts/wifi_set_static_ip.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_set_static_ip.sh (.../wifi_set_static_ip.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_set_static_ip.sh (.../wifi_set_static_ip.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,4 +21,4 @@ exit 0 fi -ifconfig $1 $2 \ No newline at end of file +sudo ifconfig $1 $2 Index: scripts/wifi_set_subnetmask.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_set_subnetmask.sh (.../wifi_set_subnetmask.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_set_subnetmask.sh (.../wifi_set_subnetmask.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -21,4 +21,4 @@ exit 0 fi -ifconfig $1 netmask $2 \ No newline at end of file +sudo ifconfig $1 netmask $2 Index: scripts/wifi_start_wpa_supplicant.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_start_wpa_supplicant.sh (.../wifi_start_wpa_supplicant.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_start_wpa_supplicant.sh (.../wifi_start_wpa_supplicant.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -25,7 +25,7 @@ wpa_supplicant_path=$2 # make sure hardware is up -ip link set $iface up +sudo ip link set $iface up # restart the wpa_supplicant service for wifi -systemctl restart wpa_supplicant@"$iface".service +sudo systemctl restart wpa_supplicant@"$iface".service Index: scripts/wifi_test_internet.sh =================================================================== diff -u -rd4988df80c5d03fe46e42c9563043ae281247278 -r01b9447a564c79628976078d442b8fa198adec97 --- scripts/wifi_test_internet.sh (.../wifi_test_internet.sh) (revision d4988df80c5d03fe46e42c9563043ae281247278) +++ scripts/wifi_test_internet.sh (.../wifi_test_internet.sh) (revision 01b9447a564c79628976078d442b8fa198adec97) @@ -22,4 +22,4 @@ fi iface=$1 -ping -I $iface -c 4 www.linuxfoundation.org +sudo ping -I $iface -c 4 www.linuxfoundation.org