Skip to content

Commit

Permalink
Create start_gps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
thadavale authored Nov 11, 2024
1 parent dab61e0 commit ebe0cbe
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions NaviGator/scripts/start_gps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Create systemd service
service_file='/etc/systemd/system/sdgps.service'

# Remove existing service file if it exists
if [ -f $service_file ]; then
rm $service_file
fi

# Write the content of the service file without outputting to terminal
echo '[Unit]' > $service_file
echo 'Description=Start GPS Service for NaviGator' >> $service_file
echo 'After=network.target' >> $service_file
echo '' >> $service_file
echo '[Service]' >> $service_file
echo 'ExecStart=NaviGator/mission_control/navigator_launch/launch/hardware/gps.launch' >> $service_file
echo 'User=navigator' >> $service_file
echo 'Restart=always' >> $service_file
echo '' >> $service_file
echo '[Install]' >> $service_file
echo 'WantedBy=multi-user.target' >> $service_file

# Reload systemd to recognize the new service
systemctl daemon-reload
systemctl enable sdgps.service
systemctl start sdgps.service

0 comments on commit ebe0cbe

Please sign in to comment.