bash.install 294 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. post_install() {
  3. for i in 'bash' 'rbash'; do
  4. grep -qx "/bin/${i}" 'etc/shells' || echo "/bin/${i}" >> 'etc/shells'
  5. done
  6. unset i
  7. }
  8. post_upgrade() {
  9. post_install
  10. }
  11. post_remove() {
  12. for i in 'bash' 'rbash'; do
  13. sed -i "\|^/bin/${i}$|d" 'etc/shells'
  14. done
  15. unset i
  16. }