OSRF_CONF_DIR="/openils/conf"
LIB_IPS_TXT="$OSRF_CONF_DIR/lib_ips.txt"
BRICK_HEADS="6" # number of brick heads you have - script assumes you're running on brick01-head
+EDITOR="/usr/bin/editor"
[[ $(whoami) != "opensrf" ]] && echo "Must be opensrf user to run this utility." && exit
done;
}
+EditCopy () {
+$EDITOR $LIB_IPS_TXT
+read -p "Would you like to copy the file to the other brick heads? (y/n)" COPYFILE
+if [ "$COPYFILE" = "y" ]; then
+ CopyFile
+elif [ "$COPYFILE" = "n" ]; then
+ echo "Not copying file."
+ exit;
+else
+ echo "No valid response received. Not copying file."
+fi
+}
+
+
echo "This program allows you to query and/or update the Evergreen Library IP redirection file on each of the application bricks."
echo
echo "What would you like to do?"
echo
echo "[1] Query the lib_ips.txt file by library name or IP address"
echo "[2] Update the file with a new entry"
+echo "[3] Manually edit, then optionally copy the file to the other brick heads"
echo
read -p "Please choose option 1 or 2: " RESPONSE
if [ "$RESPONSE" = "1" ]; then
QueryFile
elif [ "$RESPONSE" = "2" ]; then
UpdateFile && echo "The file is updated" && CopyFile
+elif [ "$RESPONSE" = "3" ]; then
+ EditCopy
else
echo "No valid response received. Aborting."
exit;