summarylogtreecommitdiffstats
path: root/asciiville.install
blob: 21168b3a41fe914d00c514580984ab92ace53a5c (plain)
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
60
61
62
63
64
65
66
post_install() {
  lol_inst=`type -p lolcat`
  if [ ! "${lol_inst}" ]
  then
    gem_inst=`type -p gem`
    if [ "${gem_inst}" ]
    then
      wget_inst=`type -p wget`
      if [ "${wget_inst}" ]
      then
        unzip_inst=`type -p unzip`
        if [ "${unzip_inst}" ]
        then
          wget --quiet https://github.com/busyloop/lolcat/archive/master.zip
          unzip -qq master.zip
          cd lolcat-master/bin
          gem install lolcat
          cd ../..
          rm -f master.zip
          rm -rf lolcat-master
        fi
      fi
    fi
  fi

  FIGLET_DIR="/usr/share/figlet-fonts"
  FIGLET_ZIP="figlet-fonts.zip"
  zip_inst=`type -p zip`
  if [ "${zip_inst}" ]
  then
    python -m pip install setuptools 2> /dev/null
    pyfig_inst=`type -p pyfiglet`
    [ "${pyfig_inst}" ] || {
      python -m pip install pyfiglet 2> /dev/null
      pyfig_inst=`type -p pyfiglet`
    }
    if [ "${pyfig_inst}" ]
    then
      if [ -d ${FIGLET_DIR} ]
      then
        cd ${FIGLET_DIR}
        zip -q ${FIGLET_ZIP} *.flf
        pyfiglet -L ${FIGLET_ZIP}
        rm -f ${FIGLET_ZIP}
      fi
    fi
  fi

  printf "%b\n" "${ascin}"
}

post_remove() {
  if [ -f /etc/profile.d/asciiville.sh ]
  then
    rm -f /etc/profile.d/asciiville.sh
  fi
}

read -d '' ascin <<'EOF'
Perform the following post-installation initialization:
  - Run the 'ascinit' command as your normal user (REQUIRED)

View additional post-installation configuration details at:
  - https://github.com/doctorfree/Asciiville#readme
  - https://github.com/doctorfree/Asciiville/wiki
EOF