what do you think about a central configuration file for linux systems?
on my ubuntu server with openaudit svn 903 i tried it out: i generated a file called linux.config under the directory
scripts with the following content:
linux.config:OASERVER="openaudit.your.net"
SUBNET="192.168.xxx.0"
NETMASK="255.255.xxx.xxx"
NMAP_NET="192.168.xxx"then i modified the
audit_linux.sh in that way:
in line 3 i added following code:
. linux.configthen i modified the line with:
wget --post-data="submit=submit&add=$audit_result" http://192.168.xxx.xxx/oa/admin_pc_add_2.phpto:
wget --post-data="submit=submit&add=$audit_result" http://"$OASERVER"/oa/admin_pc_add_2.php
...as well as the
nmap_linux.sh:
#!/bin/bash
. linux.config
for ((a=1; a <= 254 ; a++))
do
echo "$NMAP_NET.$a"
nmap_file="nmap_file.txt"
nmap_input=`nmap -v -O -oN $nmap_file $NMAP_NET.$a`
nmap_output=`cat $nmap_file`
wget -q --post-data="submit=submit&add=$nmap_output" http://"$OASERVER"/oa/admin_nmap_input.php
rm "$nmap_file"
rm "admin_nmap_input.php"
done
i think it is easier to change the setting of the network-config in one central file.
what do you think?
cheers xiam