Saltstack Official Linux Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

27 lines
811B

  1. #!/bin/bash
  2. if [ "$(basename $EDITOR 2>/dev/null)" == "$(basename $0)" ]; then
  3. PROFILES=$(debconf-get-selections | grep libpam-runtime/profiles | awk '{$1=$2=$3=""; print $0}')
  4. for profile in ${PROFILE[@]}; do
  5. if [[ $PROFILES =~ $profile ]]; then
  6. continue
  7. else
  8. PROFILES="${PROFILES}, ${profile}"
  9. fi
  10. done
  11. for profile in /usr/share/pam-configs/*; do
  12. profile_name=$(grep Name: $profile | cut -d ' ' -f 2-)
  13. PROFILES=$(echo $PROFILES | sed s,$(basename $profile),"${profile_name}",g)
  14. done
  15. cat > $1 <<EOF
  16. libpam-runtime/profiles="${PROFILES}"
  17. EOF
  18. else
  19. [ -z $1 ] && { echo "Usage: $0 [PROFILE]"; exit 1; }
  20. export PROFILE="$*"
  21. EDITOR=/usr/local/bin/pam-add-profile DEBIAN_FRONTEND=editor pam-auth-update --force
  22. fi