swupdate.sh 1.2 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # Override these variables in sourced script(s) located
  3. # in /usr/lib/swupdate/conf.d or /etc/swupdate/conf.d
  4. SWUPDATE_ARGS="-v ${SWUPDATE_EXTRA_ARGS}"
  5. SWUPDATE_WEBSERVER_ARGS=""
  6. SWUPDATE_SURICATTA_ARGS=""
  7. # source all files from /etc/swupdate/conf.d and /usr/lib/swupdate/conf.d/
  8. # A file found in /etc replaces the same file in /usr
  9. for f in `(test -d @LIBDIR@/swupdate/conf.d/ && ls -1 @LIBDIR@/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do
  10. if [ -f /etc/swupdate/conf.d/$f ]; then
  11. . /etc/swupdate/conf.d/$f
  12. else
  13. . @LIBDIR@/swupdate/conf.d/$f
  14. fi
  15. done
  16. # handle variable escaping in a simmple way. Use exec to forward open filedescriptors from systemd open.
  17. if [ "$SWUPDATE_WEBSERVER_ARGS" != "" -a "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  18. exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS" -u "$SWUPDATE_SURICATTA_ARGS"
  19. elif [ "$SWUPDATE_WEBSERVER_ARGS" != "" ]; then
  20. exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS"
  21. elif [ "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  22. exec /usr/bin/swupdate $SWUPDATE_ARGS -u "$SWUPDATE_SURICATTA_ARGS"
  23. else
  24. exec /usr/bin/swupdate $SWUPDATE_ARGS
  25. fi