Rev 11 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4 | daniel-mar | 1 | #!/bin/bash |
2 | |||
5 | daniel-mar | 3 | # |
11 | daniel-mar | 4 | # VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois) |
5 | daniel-mar | 5 | # Installer / Uninstaller |
6 | # |
||
7 | # (c) 2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de> |
||
8 | # |
||
9 | # License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2) |
||
10 | # |
||
11 | |||
4 | daniel-mar | 12 | DIR=$( dirname "$0" ) |
13 | REAL_DIR=$( cd "$DIR" && pwd ) |
||
14 | |||
5 | daniel-mar | 15 | # --- STEP 0: Are we root? |
16 | |||
17 | if [[ $EUID > 0 ]]; then |
||
18 | >&2 echo "You need to be root to execute this program." |
||
19 | exit 1 |
||
20 | fi |
||
21 | |||
4 | daniel-mar | 22 | # --- STEP 1: Install required packages |
23 | |||
24 | # Required for the program itself: |
||
131 | daniel-mar | 25 | # - perl (used by vgwhois main program. used by 6to4 and Teredo subprogram) |
26 | # - libwww-perl (cpan LWP::Simple; used by vgwhois main program) |
||
27 | # - libnet-libidn-perl (cpan Net::LibIDN; used by vgwhois main program) |
||
11 | daniel-mar | 28 | # - (commented out) libencode-detect-perl (cpan Encode::Detect; used by vgwhois main program) |
131 | daniel-mar | 29 | # - curl (used by some parts of the vgwhois main program. used by pattern generator and subprograms) |
30 | # - lynx (used by some parts of the vgwhois main program) |
||
11 | daniel-mar | 31 | # - libnet-ip-perl (cpan Net::IP; used for IPv6 interpretation by Teredo subprogram and vgwhois main program) |
32 | # - libnet-dns-perl (cpan Net::DNS; used by Teredo subprogram) |
||
33 | # - libmath-bigint-gmp-perl (cpan Math::BigInt; used for IPv6 masking by vgwhois main program) |
||
34 | # - php7.0-cli (used by subprograms and pattern-generator) |
||
4 | daniel-mar | 35 | # |
36 | # Required for the maintenance tools |
||
11 | daniel-mar | 37 | # - php7.0-gmp (used by IPv6 pattern generator) |
4 | daniel-mar | 38 | # - netcat (used by the whois-ping maintainance program) |
39 | # - php7.0-sqlite3 (used by the whois-ping maintainance program) |
||
40 | # |
||
6 | daniel-mar | 41 | # TODO: How to make the installation of the packages fit to most distros? |
4 | daniel-mar | 42 | |
6 | daniel-mar | 43 | apt-get update |
131 | daniel-mar | 44 | apt-get install perl libwww-perl libnet-libidn-perl curl lynx libnet-ip-perl \ |
45 | libnet-dns-perl libmath-bigint-gmp-perl php-cli php-gmp netcat \ |
||
46 | php-sqlite3 libmath-bigint-perl php-gmp |
||
4 | daniel-mar | 47 | |
48 | # --- STEP 2: "Install" symlinks |
||
49 | |||
11 | daniel-mar | 50 | if [ -L /usr/bin/vgwhois ]; then |
51 | rm /usr/bin/vgwhois |
||
4 | daniel-mar | 52 | fi |
11 | daniel-mar | 53 | ln -s "$REAL_DIR"/main/vgwhois /usr/bin/vgwhois |
54 | echo "Symlink /usr/bin/vgwhois created" |
||
4 | daniel-mar | 55 | |
5 | daniel-mar | 56 | # --- |
57 | |||
11 | daniel-mar | 58 | if [ -L /usr/sbin/vgwhois-pattern-update ]; then |
59 | rm /usr/sbin/vgwhois-pattern-update |
||
4 | daniel-mar | 60 | fi |
11 | daniel-mar | 61 | ln -s "$REAL_DIR"/maintenance/pattern-generator/vgwhois-pattern-update /usr/sbin/vgwhois-pattern-update |
62 | echo "Symlink /usr/sbin/vgwhois-pattern-update created" |
||
4 | daniel-mar | 63 | |
5 | daniel-mar | 64 | # --- |
65 | |||
11 | daniel-mar | 66 | if [ -L /usr/sbin/vgwhois-qa-check ]; then |
67 | rm /usr/sbin/vgwhois-qa-check |
||
4 | daniel-mar | 68 | fi |
11 | daniel-mar | 69 | ln -s "$REAL_DIR"/maintenance/qa-monitor/run /usr/sbin/vgwhois-qa-check |
70 | echo "Symlink /usr/sbin/vgwhois-qa-check created" |
||
4 | daniel-mar | 71 | |
5 | daniel-mar | 72 | # --- |
73 | |||
11 | daniel-mar | 74 | if [ -L /usr/sbin/vgwhois-update ]; then |
75 | rm /usr/sbin/vgwhois-update |
||
4 | daniel-mar | 76 | fi |
11 | daniel-mar | 77 | ln -s "$REAL_DIR"/update.sh /usr/sbin/vgwhois-update |
78 | echo "Symlink /usr/sbin/vgwhois-update created" |
||
4 | daniel-mar | 79 | |
5 | daniel-mar | 80 | # --- |
81 | |||
11 | daniel-mar | 82 | if [ -L /usr/share/man/man1/vgwhois.1 ]; then |
83 | rm /usr/share/man/man1/vgwhois.1 |
||
4 | daniel-mar | 84 | fi |
11 | daniel-mar | 85 | ln -s "$REAL_DIR"/man/man1/vgwhois.1 /usr/share/man/man1/vgwhois.1 |
86 | echo "Symlink /usr/share/man/man1/vgwhois.1 created" |
||
4 | daniel-mar | 87 |