checker 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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. UPGRADEMODE="upgrade"
  23. echo "" | tee /usr/share/urukUpdater/status/err /usr/share/urukUpdater/status/result
  24. apt-get update 1> /usr/share/urukUpdater/status/result 2> /usr/share/urukUpdater/status/err
  25. apt-get $UPGRADEMODE --dry-run | grep ^Inst | awk '{print $2}' > /usr/share/urukUpdater/status/upd.list
  26. NUM=$(< /usr/share/urukUpdater/status/upd.list wc -l)
  27. sed -i "s/NUM=.*/NUM=$NUM/" /usr/share/urukUpdater/updater-status
  28. sed -i "s/NUM=.*/NUM=$NUM/" /usr/lib/urukUpdater/setter
  29. sudo /usr/lib/urukUpdater/setter &> /dev/null &
  30. exit 0