-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from ethz-asl/projects/piloting_feature/syste…
…md_services Add systemd services to the repo
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Unit] | ||
After=network-online.target | ||
[Service] | ||
Type=forking | ||
User=piloting | ||
ExecStart=/bin/sh -c ". /opt/ros/noetic/setup.sh; export ROS_MASTER_URI=http://192.168.195.5:11311; export ROS_IP=192.168.195.5; echo $ROS_MASTER_URI; roscore & while ! echo exit | nc localhost 11311 > /dev/null; do sleep 1; done" | ||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Piloting Router | ||
|
||
This script makes the SMB261-Panda NUC a router, forwarding traffic from other PCs via its WiFi connection to the internet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Piloting router | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/home/smb/router.sh | ||
RemainAfterExit=true | ||
Type=oneshot | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
sudo bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' | ||
sudo nmcli radio wifi on | ||
sudo iptables -t nat -A POSTROUTING -o wlp0s20f3 -j MASQUERADE | ||
sudo iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE | ||
sudo iptables -A FORWARD -i eno0 -o wlp0s20f3 -j ACCEPT | ||
sudo iptables -A FORWARD -i eno0 -o eno1 -j ACCEPT | ||
sudo iptables -A FORWARD -i wlp0s20f3 -o eno0 -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
sudo iptables -A FORWARD -i eno1 -o eno0 -m state --state RELATED,ESTABLISHED -j ACCEPT |