forked from netxms/packages-deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netxms-server.postinst
96 lines (72 loc) · 1.87 KB
/
netxms-server.postinst
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
set -e
CONFIG="/etc/netxmsd.conf"
case "$1" in
configure)
if [ ! -f $CONFIG ]; then
TARGET=$CONFIG
cat <<__END
NetXMS server is installed but currently stopped.
Additional steps required:
1. Edit default configuration file ($CONFIG)
2. Load database schema
nxdbmgr init
3. Start daemon with command:
systemctl start netxms-server
__END
else
TARGET=${CONFIG}.dist
fi
cat > $TARGET <<__END
## Logging
# Log file name
LogFile=/var/log/netxmsd
# Increase logging verbosity, 0 (only errors) to 9 (verbose debug)
#DebugLevel=3
## Database configuration.
## Uncomment and setup ONE section.
## Option #1 - SQLite (for test installations only):
#DBDriver=sqlite.ddr
#DBName=/var/lib/netxms/netxms.db
## Option #2 - PostgreSQL (recommended):
#DBDriver=pgsql.ddr
#DBServer=127.0.0.1
#DBName=netxms
#DBLogin=netxms
#DBPassword=netxms
## Option #3 - MySQL:
#DBDriver=mysql.ddr
#DBServer=127.0.0.1
#DBName=netxms
#DBLogin=netxms
#DBPassword=netxms
## Option #4 - Oracle:
#DBDriver=oracle.ddr
#DBServer=//127.0.0.1:1521/ORCL # Instant Client connection string or SID
#DBLogin=netxms
#DBPassword=netxms
## Option #5 - unixODBC/FreeTDS:
#DBDriver=odbc.ddr
#DBServer=NETXMS_DSN
#DBLogin=netxms
#DBPassword=netxms
__END
if [ ! -z $2 ]; then
# previous version is set, it's upgrade
/usr/bin/nxdbmgr upgrade
/usr/bin/nxdbmgr online-upgrade >/dev/null 2>/dev/null &
fi
# compile MIBs
/usr/bin/nxmibc -o /var/lib/netxms/netxms.mib -d /usr/share/netxms/mibs -z >/dev/null || true
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0