diff options
author | root <root@rshg054.dnsready.net> | 2013-06-04 00:27:56 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-06-04 00:27:56 -0700 |
commit | cc57cb201ddb179d2bb481c13dd4f286ae643b12 (patch) | |
tree | 7932470d6b8a193c032f1012a7996cc78ea52201 /community/tcsh/tcsh.install | |
parent | 1f86bf1b08cb980cea57c1d4d3187e2251f5a63b (diff) |
Tue Jun 4 00:27:56 PDT 2013
Diffstat (limited to 'community/tcsh/tcsh.install')
-rw-r--r-- | community/tcsh/tcsh.install | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/community/tcsh/tcsh.install b/community/tcsh/tcsh.install index 023ddd115..00911470f 100644 --- a/community/tcsh/tcsh.install +++ b/community/tcsh/tcsh.install @@ -1,25 +1,23 @@ post_install() { - if [ ! "`grep /bin/tcsh etc/shells`" ]; then - echo "updating /etc/shells... done." - sed -i "s|/bin/bash|/bin/bash\n/bin/tcsh\n/bin/csh|" etc/shells - else - sed -i "s|/usr/bin/tcsh|/bin/tcsh|" etc/shells - sed -i "s|/usr/bin/csh|/bin/csh|" etc/shells - - echo "" - echo ">> WARNING: /usr/bin/tcsh has moved to /bin/tcsh," - echo ">> WARNING: /usr/bin/csh has moved to /bin/csh," - echo ">> please update your user accounts as needed" - echo "" + if ! grep -q /bin/tcsh etc/shells; then + echo /bin/tcsh >> etc/shells + echo /bin/csh >> etc/shells + echo 'Added to /etc/shells.' fi } post_upgrade() { - post_install $1 + if grep -q /usr/bin/tcsh etc/shells; then + sed -i 's|/usr/bin/tcsh|/bin/tcsh|' etc/shells + sed -i 's|/usr/bin/csh|/bin/csh|' etc/shells + echo 'Fixed path in /etc/shells.' + fi } pre_remove() { - echo "updating /etc/shells... done." - sed -i "\|/bin/tcsh|d" etc/shells - sed -i "\|/bin/csh|d" etc/shells + sed -i '\|/bin/tcsh|d' etc/shells + sed -i '\|/bin/csh|d' etc/shells + echo 'Removed from /etc/shells.' } + +# vim:set ts=2 sw=2 et: |