From 87964e593bc2473a15775f2921a46db6b38f698d Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Sun, 2 Aug 2020 17:26:23 +0200 Subject: [PATCH] fixed shebang and better salt function --- .functions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.functions.sh b/.functions.sh index 88126a2..0a7c5b5 100644 --- a/.functions.sh +++ b/.functions.sh @@ -1,5 +1,10 @@ +#!/bin/bash function salt() { - sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@" pillar="{username: $USER}" + if [[ "$1" == "state.apply" ]]; then + sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@" pillar="{username: $USER}" + else + sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@" + fi } function pw(){