Permalink
Browse files

Migrate map options on update only when maps are defined

  • Loading branch information...
macarrie authored and LarsMichelsen committed Nov 23, 2017
1 parent b7f82b7 commit 86a90788e8f6db3e8115432b0a974547fdb479e4
Showing with 21 additions and 18 deletions.
  1. +21 −18 install.sh
View
@@ -1573,27 +1573,30 @@ if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" != "UNKNOWN" -a "$INSTA
sed -i '/^requestmaxlength=/d' $NAGVIS_PATH/etc/nagvis.ini.php
chk_rc "| Error" "$DONE"
DONE=`log "Removing allowed_for_config option from map configs..." done`
grep -r '^allowed_for_config=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP
sed -i '/^allowed_for_config=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing allowed_user from map configs..." done`
grep -r '^allowed_user=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP
sed -i '/^allowed_user=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
# Remove options from maps only if maps are defined
if [ `find $NAGVIS_PATH/etc/maps -type f -name "*.cfg" | wc -l` -gt 0 ]; then
DONE=`log "Removing allowed_for_config option from map configs..." done`
grep -r '^allowed_for_config=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP
sed -i '/^allowed_for_config=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing hover_timeout from map configs..." done`
sed -i '/^hover_timeout=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing allowed_user from map configs..." done`
grep -r '^allowed_user=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP
sed -i '/^allowed_user=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing usegdlibs from map configs..." done`
sed -i '/^usegdlibs=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing hover_timeout from map configs..." done`
sed -i '/^hover_timeout=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing gadget_type from map configs..." done`
sed -i '/^gadget_type=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing usegdlibs from map configs..." done`
sed -i '/^usegdlibs=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
DONE=`log "Removing gadget_type from map configs..." done`
sed -i '/^gadget_type=/d' $NAGVIS_PATH/etc/maps/*.cfg
chk_rc "| Error" "$DONE"
fi
line
fi

0 comments on commit 86a9078

Please sign in to comment.