Skip to content

Commit ddce258

Browse files
Update hostCorrect.sh
Implemented the actual command to change the files to the script so it wouldn't continually loop without making the correction.
1 parent 446105c commit ddce258

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/hostCorrect.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ if [ $CURRENT_HOST = $HOSTNAME ]; then
1313
else
1414
echo "$(date +"%Y-%m-%d %H:%M:%S.%3N") ${HOSTNAME}: Currently configured host name: $CURRENT_HOST. Reconfiguring inputs.conf..."
1515
cp $INPUTS_FILE $INPUTS_FILE.$(date +"%m%d%Y")
16+
sed -i "s/$CURRENT_HOST/$HOSTNAME/" $INPUTS_FILE
1617
touch $RESTART_INPUT_CHECK
1718
fi
1819
if [ $CURRENT_SERVER = $HOSTNAME ]; then
1920
echo "$(date +"%Y-%m-%d %H:%M:%S.%3N") ${HOSTNAME}: Currently configured server name: $CURRENT_SERVER. No correction necessary..."
2021
else
2122
echo "$(date +"%Y-%m-%d %H:%M:%S.%3N") ${HOSTNAME}: Currently configured server name: $CURRENT_SERVER. Reconfiguring inputs.conf..."
2223
cp $SERVER_FILE $SERVER_FILE.$(date +"%m%d%Y")
24+
sed -i "s/$CURRENT_SERVER/$HOSTNAME/" $SERVER_FILE
2325
touch $RESTART_SERVER_CHECK
24-
fi
26+
fi

0 commit comments

Comments
 (0)