Skip to content

Commit

Permalink
Only turn off default gateway if bb-usb-gadgets is installed.
Browse files Browse the repository at this point in the history
SOFT-620
  • Loading branch information
Jake Danczyk committed Apr 8, 2021
1 parent 7ee70e0 commit 668b77d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion postUpdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ fi
# Prevent shared memory from being cleaned up when pocketnc user closes SSH
sudo sed -i 's/^#RemoveIPC=yes/RemoveIPC=no/' /etc/systemd/logind.conf
# Remove line which is incorrectly setting usb0 as default gateway from /etc/network/interfaces
sudo sed -i 's/^\([^#]*gateway\)/#\1/g' /etc/network/interfaces
# ONLY IF bb-usb-gadgets IS INSTALLED.
# We would rather have:
# - usb tethering working, network gateway broken
# than
# - network gateway working, usb tethering broken
if dpkg-query -s bb-usb-gadgets | grep "install ok installed"; then
sudo sed -i 's/^\([^#]*gateway\)/#\1/g' /etc/network/interfaces
else
sudo sed -i '/gateway/s/#//g' /etc/network/interfaces
fi


cd /home/pocketnc/pocketnc/Settings
Expand Down

0 comments on commit 668b77d

Please sign in to comment.