summarylogtreecommitdiffstats
path: root/smarttrafficmeter.install
blob: a9ecabf2e20b34612e281bea278d7556584ec4f8 (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
post_install() {
    systemctl enable smarttrafficmeter
    echo "Please wait for the installation to complete"
    systemctl start smarttrafficmeter
    echo "#####################################################################"
    echo "#                                                                   #"
    echo "# Smart Traffic Meter should now be running as a service (daemon)   #"
    echo "# Open your web browser and navigate to 127.0.0.1:7676              #"
    echo "# If the page does not open                                         #"
    echo "# you may need to execute the following comands in the command line #"
    echo "# sudo systemctl enable smarttrafficmeter                           #"
    echo "# sudo systemctl start smarttrafficmeter                            #"
    echo "# and restart your computer                                         #"
    echo "#                                                                   #"
    echo "# To start/stop/enable/disable Smart Traffic Meter execute          #"
    echo "# sudo systemctl start/stop/enable/disable smarttrafficmeter        #"
    echo "#                                                                   #"
    echo "# default database directory: /usr/share/smarttrafficmeter          #"
    echo "# default config directory: /etc/smarttrafficmeter                  #"
    echo "# default log directory: /var/log/smarttrafficmeter                 #"
    echo "#                                                                   #"
    echo "#####################################################################"
}

pre_upgrade() {
    systemctl stop smarttrafficmeter
}

post_upgrade() {
    systemctl start smarttrafficmeter
}

pre_remove() {
    systemctl stop smarttrafficmeter
    systemctl disable smarttrafficmeter
    rm -r /etc/smarttrafficmeter
    rm -r /var/log/smarttrafficmeter
    echo "#####################################################################"
    echo "#                                                                   #"
    echo "# Smart Traffic Meter has been uninstalled.                         #"
    echo "#                                                                   #"
    echo "# The default databse directory /usr/share/smarttrafficmeter        #"
    echo "# has not been removed so that you can make database backup.        #"
    echo "# If you do not need the backup,                                    #"
    echo "# please remove this directory manually.                            #"
    echo "#                                                                   #"
    echo "#####################################################################"
}