Skip to content

Commit

Permalink
Improve setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrains1 committed Sep 18, 2024
1 parent 53e954d commit d8887aa
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions hitl-setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ done
echo All INTERFACES exist

FILES="/etc/systemd/system/fpganet.service /etc/fpganet /etc/dhcp/dhcpd.conf /etc/default/isc-dhcp-server"
EXISTS=""
for FILE in FILES; do
if [ -e "$FILE" ]; then
EXISTS=
for FILE in $FILES; do
if [ -e $FILE ]; then
EXISTS="$EXISTS $FILE"
fi
done
if [ -n "$EXISTS" -a "$FORCE" = "-f" ]; then
echo 'Running this script with -f will overwrite:'
if [ -n "$EXISTS" -a "$FORCE" != -f ]; then
set +x
echo "Running this script with -f will overwrite:"
echo "$EXISTS"
echo "But now it will stop, because -f wasn't supplied"
exit 1
Expand All @@ -34,14 +35,13 @@ apt-get install -y isc-dhcp-server iproute2
cp "$HERE/fpganet.service" /etc/systemd/system
cp "$HERE/fpganet" /etc

cp "$HERE/dhcpd.conf" /etc/dhcp/
echo "INTERFACESv4=\"$BRIDGE_NAME\"" > /etc/default/isc-dhcp-server

systemctl daemon-reload

systemctl restart fpganet.service
systemctl enable fpganet.service
systemctl restart fpganet.service

cp "$HERE/dhcpd.conf" /etc/dhcp/
echo "INTERFACESv4=\"$BRIDGE_NAME\"" > /etc/default/isc-dhcp-server

systemctl add-wants isc-dhcp-server.service fpganet.service
systemctl restart isc-dhcp-server.service
systemctl enable isc-dhcp-server.service
systemctl restart isc-dhcp-server.service

0 comments on commit d8887aa

Please sign in to comment.