Server configurator - initial import
authorAlex Kirhenshtein <alk@netxms.org>
Sun, 15 Sep 2013 13:33:07 +0000 (13:33 +0000)
committerAlex Kirhenshtein <alk@netxms.org>
Sun, 15 Sep 2013 13:33:07 +0000 (13:33 +0000)
.gitattributes
contrib/server-config [new file with mode: 0755]

index dfbaaaf..1bc8f1e 100644 (file)
@@ -329,6 +329,7 @@ contrib/mibs/WS-SW-MOBILITY-MIB.txt -text svneol=native#unset
 contrib/mibs/WS-SW-PORTVLAN-MIB.txt -text svneol=native#unset
 contrib/mibs/WS-SW-SMI.txt -text svneol=native#unset
 contrib/mibs/WS-TYPE-MIB.txt -text svneol=native#unset
+contrib/server-config -text
 contrib/startup/archlinux/nxagentd.service -text
 contrib/startup/debian/Makefile.am -text
 contrib/startup/debian/netxmsd.in -text
diff --git a/contrib/server-config b/contrib/server-config
new file mode 100755 (executable)
index 0000000..45dabd3
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+CONFIG=/etc/netxmsd.conf
+
+if [ -f $CONFIG ]; then
+       echo "Configuration file $CONFIG already exist, exiting"
+       exit 1
+fi
+
+set -e
+
+trap '
+       if [ $? != 0 ]; then
+               echo "No changes done to the system"
+       fi
+' EXIT
+
+logfile=$(whiptail --inputbox "Log file location" 7 40 /var/log/netxmsd 3>&1 1>&2 2>&3)
+dbdriver=$(whiptail --menu "Select database driver" 20 40 4 \
+       pgsql.ddr PostgreSQL \
+       mysql.ddr MySQL \
+       oracle.ddl Oracle \
+       3>&1 1>&2 2>&3)
+dbname=$(whiptail --inputbox "Database name" 7 40 netxms 3>&1 1>&2 2>&3)
+dblogin=$(whiptail --inputbox "Database login" 7 40 netxms 3>&1 1>&2 2>&3)
+dbpass=$(whiptail --passwordbox "Database password" 7 40 3>&1 1>&2 2>&3)
+
+echo "DBDriver=$dbdriver
+DBName=$dbname
+DBLogin=$dblogin
+DBPassword=$dbpass
+LogFile=$logfile" > $CONFIG