summaryrefslogtreecommitdiff
path: root/community/tcsh/tcsh.install
blob: 00911470f17e4012b39c0b864a7b87ce415bab4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
  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() {
  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() {
  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: