From d695dce1a7ea28433db8e893025d1ec66fb077b2 Mon Sep 17 00:00:00 2001 From: Dawsyn Schraiber <32221234+dawsynth@users.noreply.github.com> Date: Sun, 12 Nov 2023 01:06:57 -0500 Subject: Header styles and file naming conventions; CMake ARM Linux musl Compiler Co-authored-by: Gregory Wainer --- bbb_setup.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 bbb_setup.sh (limited to 'bbb_setup.sh') diff --git a/bbb_setup.sh b/bbb_setup.sh new file mode 100755 index 0000000..42e008d --- /dev/null +++ b/bbb_setup.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# Change based upon device specifics +IFACE_BB=enp0s20f0u5 +IFACE_SELF=wlan0 +EXE=ads + +echo "Compiling Executeables" +vagrant up +vagrant ssh << EOF + cmake /vagrant; + cmake --build .; + mkdir -p build + cp -r out/* /vagrant/build/ +EOF + +echo "Forwarding Traffic to Beaglebone" +# Forwards all internet traffic requested by beaglebone to proper interface +sudo sh -c "ip link set $IFACE_BB" +sudo sh -c "dhclient $IFACE_BB" + +sudo sh -c "iptables --table nat --append POSTROUTING --out-interface $IFACE_SELF -j MASQUERADE" +sudo sh -c "iptables --append FORWARD --in-interface $IFACE_BB -j ACCEPT" +sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" + +echo "Copying Executeables to Beaglebone" +scp -r build/* debian@beaglebone.local:~/; +rm -r build + +echo "Running Main Program" +ssh debian@beaglebone.local /bin/bash << EOF + ./$EXE; +EOF -- cgit v1.2.3