Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prompt.sh 526B

1234567891011121314151617181920
  1. {%- from "linux/map.jinja" import system with context %}
  2. # Don't set special prompt when not using Bash or ZSH
  3. [ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0
  4. # Don't set prompt on non-interactive shell
  5. [[ $- == *i* ]] || return 0
  6. {%- for user, prompt in system.prompt.items() %}
  7. {% if user != "default" %}
  8. if [ "$USERNAME" == "{{ user }}" ]; then
  9. export PS1="{{ prompt }} "
  10. return 0
  11. fi
  12. {% endif %}
  13. {%- endfor %}
  14. {% if system.prompt.default is defined %}
  15. export PS1="{{ system.prompt.default }} "
  16. {%- endif %}