freedombone-upgrade 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # Command to upgrade the system
  12. # License
  13. # =======
  14. #
  15. # Copyright (C) 2015 Bob Mottram <bob@robotics.uk.to>
  16. #
  17. # This program is free software: you can redistribute it and/or modify
  18. # it under the terms of the GNU General Public License as published by
  19. # the Free Software Foundation, either version 3 of the License, or
  20. # (at your option) any later version.
  21. #
  22. # This program is distributed in the hope that it will be useful,
  23. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. # GNU General Public License for more details.
  26. #
  27. # You should have received a copy of the GNU General Public License
  28. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. PROJECT_NAME='freedombone'
  30. FREEDOMBONE_REPO="https://github.com/bashrc/${PROJECT_NAME}"
  31. update-ca-certificates
  32. if [ ! -d /root/${PROJECT_NAME} ]; then
  33. git clone $FREEDOMBONE_REPO /root/${PROJECT_NAME}
  34. fi
  35. if [ -d /root/${PROJECT_NAME} ]; then
  36. if [ -f /root/${PROJECT_NAME}.cfg ]; then
  37. cd /root/${PROJECT_NAME}
  38. git stash
  39. git pull
  40. make install
  41. ${PROJECT_NAME} -c /root/${PROJECT_NAME}.cfg
  42. fi
  43. fi
  44. echo '
  45. ' | reset-tripwire
  46. # deliberately there is no 'exit 0' here