summary refs log tree commit diff stats
path: root/deinstall.sh
blob: 5f5161dab4db1b354f3e88ece44bdc7bfbddf44e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/sh
# Generated by niminst

if [ $# -eq 1 ] ; then
  case $1 in
    "--help"|"-h"|"help"|"h")
      echo "Nimrod deinstallation script"
      echo "Usage: [sudo] sh deinstall.sh DIR"
      echo "Where DIR may be:"
      echo "  /usr/bin"
      echo "  /usr/local/bin"
      echo "  /opt"
      echo "  <some other dir> (treated like '/opt')"
      exit 1
      ;;
    "/usr/bin")
      bindir=/usr/bin
      configdir=/etc
      libdir=/usr/lib/nimrod
      docdir=/usr/share/nimrod/doc
      datadir=/usr/share/nimrod/data
      ;;
    "/usr/local/bin")
      bindir=/usr/local/bin
      configdir=/etc
      libdir=/usr/local/lib/nimrod
      docdir=/usr/local/share/nimrod/doc
      datadir=/usr/local/share/nimrod/data
      ;;
    *)
      bindir="$1/nimrod/bin"
      configdir="$1/nimrod/config"
      libdir="$1/nimrod/lib"
      docdir="$1/nimrod/doc"
      datadir="$1/nimrod/data"
      ;;
  esac
  echo "removing files..."

  rm -f $bindir/nimrod
  rm -f $configdir/nimdoc.cfg
  rm -f $configdir/nimrod.cfg
  rm -f $configdir/nimdoc.tex.cfg
  rm -rf $docdir
  rm -rf $datadir
  rm -rf $libdir

  echo "deinstallation successful"
else
  echo "Nimrod deinstallation script"
  echo "Usage: [sudo] sh deinstall.sh DIR"
  echo "Where DIR may be:"
  echo "  /usr/bin"
  echo "  /usr/local/bin"
  echo "  /opt"
  echo "  <some other dir> (treated like '/opt')"
  exit 1
fi