swupdate.sh 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Based on example script created by Adrian Freihofer
  3. # https://github.com/sbabic/meta-swupdate/blob/master/recipes-support/swupdate/swupdate/swupdate.sh
  4. # Override these variables in sourced script(s) located
  5. # in /usr/lib/swupdate/conf.d or /etc/swupdate/conf.d
  6. SWUPDATE_ARGS="-v ${SWUPDATE_EXTRA_ARGS}"
  7. SWUPDATE_WEBSERVER_ARGS=""
  8. SWUPDATE_SURICATTA_ARGS=""
  9. # source all files from /etc/swupdate/conf.d and /usr/lib/swupdate/conf.d/
  10. # A file found in /etc replaces the same file in /usr
  11. for f in `(test -d /usr/lib/swupdate/conf.d/ && ls -1 /usr/lib/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do
  12. if [ -f /etc/swupdate/conf.d/$f ]; then
  13. . /etc/swupdate/conf.d/$f
  14. else
  15. . /usr/lib/swupdate/conf.d/$f
  16. fi
  17. done
  18. if [ "$SWUPDATE_WEBSERVER_ARGS" != "" -a "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  19. exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS" -u "$SWUPDATE_SURICATTA_ARGS"
  20. elif [ "$SWUPDATE_WEBSERVER_ARGS" != "" ]; then
  21. exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS"
  22. elif [ "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  23. exec /usr/bin/swupdate $SWUPDATE_ARGS -u "$SWUPDATE_SURICATTA_ARGS"
  24. else
  25. exec /usr/bin/swupdate $SWUPDATE_ARGS
  26. fi