5 [ "$1" = "configure" ] || exit 0
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
9 . /usr/share/carnet-tools/functions.sh
11 . /usr/share/debconf/confmodule
14 ocsserver="https://inventory.CARNet.hr/ocsinventory"
16 db_get ocsinventory-agent/method || true
19 if [ "$method" != "$ocsmethod" ]; then
20 db_set ocsinventory-agent/method "$ocsmethod" || true
23 db_get ocsinventory-agent/server
26 if [ "$server" != "$ocsserver" ]; then
27 db_set ocsinventory-agent/server "$ocsserver"
31 cp_check_and_sed "^server" \
32 "s#^server.*#server=$ocsserver#g" \
33 /etc/ocsinventory/ocsinventory-agent.cfg \
34 && set_ocsserver="yes" || true
36 if [ "$set_ocsserver" = "yes" ]; then
37 echo "CN: OCS Inventory server: $ocsserver"
40 if ! grep -q ^server= /etc/ocsinventory/ocsinventory-agent.cfg; then
41 echo "server=$ocsserver" >> /etc/ocsinventory/ocsinventory-agent.cfg