#! /bin/bash . /usr/src/k_framework/main.sh SCRIPT_NAME="[CLIENT] tag set/change" VERSION="1.1.5" k_config_details k_start k_default_interface_ip config="/home/$SYSTEM_GUI_DIR/config/environment.rb" if [[ ! -e $config ]]; then report "$config not present" 1 EXIT_CODE=1 fi FAST=0 if [[ $1 == "FAST" ]]; then FAST=1 fi answer= if [[ $FAST == 0 ]]; then read -p $"Enter Client name for [CLIENT] tag (press enter for External IP as tag: $EXTERNAL_IP): " answer fi if [[ $answer == "" ]]; then answer=$EXTERNAL_IP; fi sed -i "s/ExceptionNotifier_email_prefix.*/ExceptionNotifier_email_prefix = \"[$answer]\"/" "$config" if grep -Fq "$answer" $config; then report "[CLIENT] tag was set to [$answer]" 0 else report "Failed to set [CLIENT] tag in $config. Set manually" 1 EXIT_CODE=1 fi k_exit $EXIT_CODE