aboutsummaryrefslogtreecommitdiff
path: root/system/fdclone/doinst.sh
blob: 35eeb7942438982105e80dcde0787e89e59f1b71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
}

config etc/fdclone/fd2rc.siteconfig.new

# If there's no fd link, take over:
if [ ! -r usr/bin/fd ]; then
  ( cd usr/bin ; rm -rf fd )
  ( cd usr/bin ; ln -sf fdclone fd )
  ( cd usr/man/man1 ; rm -rf fd.1.gz )
  ( cd usr/man/man1 ; ln -sf fdclone.1.gz fd.1.gz )
  ( cd usr/man/ja/man1 ; rm -rf fd.1.gz )
  ( cd usr/man/ja/man1 ; ln -sf fdclone.1.gz fd.1.gz )
fi