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