restart 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Uruk Update Manager
  5. #
  6. # Copyright 2022 hayder majid <hayder@riseup.net>
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  21. # MA 02110-1301, USA.
  22. CHECK_PRO="$(ps -ef | grep '[p]ython3 /usr/share/urukUpdater/urukupdater.py' | awk '{print $2}')"
  23. if [ "${CHECK_PRO}" != "" ]; then
  24. kill -9 $CHECK_PRO
  25. python3 /usr/share/urukUpdater/urukupdater.py &> /dev/null &
  26. else
  27. python3 /usr/share/urukUpdater/urukupdater.py &> /dev/null &
  28. fi
  29. exit 0