run 655 B

123456789101112131415161718192021222324252627
  1. #!/command/with-contenv /bin/bash
  2. # shellcheck disable=SC1091,SC2068
  3. # =============================
  4. # GPUStack server longrun service
  5. # =============================
  6. source /etc/profile
  7. SCRIPT_ROOT=/etc/s6-overlay/scripts
  8. source "$SCRIPT_ROOT/base.sh"
  9. ARGS_FILE="/run/gpustack/args"
  10. # Read arguments from the args file if it exists and is not empty
  11. set --
  12. if [ -s "$ARGS_FILE" ]; then
  13. while IFS= read -r line || [ -n "$line" ]; do
  14. [ -z "$line" ] && continue
  15. set -- "$@" "$line"
  16. done < "$ARGS_FILE"
  17. fi
  18. echo "[INFO] Starting gpustack server."
  19. if [ "$#" -gt 0 ]; then
  20. exec gpustack start "$@"
  21. else
  22. exec gpustack start
  23. fi