get_syncthing_status.sh 489 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. syncthing_status=$(systemctl --user status syncthing.service | grep Active | awk '{print $2}')
  3. if [[ ${syncthing_status} == "active" ]]
  4. then
  5. # systemctl --user stop syncthing.service &
  6. # notify-send -i dialog-information "Syncthing service stopped"
  7. # echo "inactive"
  8. echo "active"
  9. else
  10. # systemctl --user start syncthing.service &
  11. # notify-send -i dialog-information "Syncthing service started"
  12. # echo "active"
  13. echo "inactive"
  14. fi