diff --git a/install b/install index 68897186..5d99333a 100755 --- a/install +++ b/install @@ -469,12 +469,21 @@ else fi fi -if [[ $(diff /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then - echo "changed cubesatsim.service." +FILE=/etc/systemd/system/cubesatsim.service +if [ -f "$FILE" ]; then + if [[ $(diff /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then + echo "changed cubesatsim.service." + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + FLAG=1 + else + echo "no changes to cubesatsim.service." + fi +else + echo "creating cubesatsim.service." sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + sudo systemctl enable command + FLAG=1 -else - echo "no changes to cubesatsim.service." fi FILE=/etc/systemd/system/rpitx.service