tst-pam_motd4.sh 491 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. TST_DIR="tst-pam_motd4.d"
  3. function tst_cleanup() {
  4. rm -rf "${TST_DIR}"
  5. rm -f tst-pam_motd4.out
  6. }
  7. mkdir -p ${TST_DIR}/etc
  8. # Verify the case of single motd with no motd_dir given in tst-pam_motd4.pamd
  9. echo "motd: /etc/motd" > ${TST_DIR}/etc/motd
  10. ./tst-pam_motd tst-pam_motd4 > tst-pam_motd4.out
  11. RET=$?
  12. motd_to_show_output=$(cat tst-pam_motd4.out | grep "motd: /etc/motd")
  13. if [ -z "${motd_to_show_output}" ];
  14. then
  15. tst_cleanup
  16. exit 1
  17. fi
  18. tst_cleanup
  19. exit $RET