added Eclipse project for Tuxedo subagent
[public/netxms.git] / contrib / server-config
1 #!/bin/sh
2
3 CONFIG=/etc/netxmsd.conf
4
5 if [ -f $CONFIG ]; then
6 echo "Configuration file $CONFIG already exist, exiting"
7 exit 1
8 fi
9
10 set -e
11
12 trap '
13 if [ $? != 0 ]; then
14 echo "No changes done to the system"
15 fi
16 ' EXIT
17
18 logfile=$(whiptail --inputbox "Log file location" 7 40 /var/log/netxmsd 3>&1 1>&2 2>&3)
19 dbdriver=$(whiptail --menu "Select database driver" 20 40 4 \
20 pgsql.ddr PostgreSQL \
21 mysql.ddr MySQL \
22 oracle.ddl Oracle \
23 3>&1 1>&2 2>&3)
24 dbname=$(whiptail --inputbox "Database name" 7 40 netxms 3>&1 1>&2 2>&3)
25 dblogin=$(whiptail --inputbox "Database login" 7 40 netxms 3>&1 1>&2 2>&3)
26 dbpass=$(whiptail --passwordbox "Database password" 7 40 3>&1 1>&2 2>&3)
27
28 echo "DBDriver=$dbdriver
29 DBName=$dbname
30 DBLogin=$dblogin
31 DBPassword=$dbpass
32 LogFile=$logfile" > $CONFIG