Commit 52ecf392 authored by Peter Kovary's avatar Peter Kovary
Browse files

Use $hostsFile in gethosts to avoid typos

Just as happened in the last commit
parent 70230ff2
#!/bin/bash
hostsFile='./.hosts'
if [ "$1" == "-f" ]
then
rm -f ./hosts
rm -f "$hostsFile"
fi
if [ ! -f ./.hosts ]; then
if [ ! -f "$hostsFile" ]; then
origin=(`ifconfig -a eno1 | grep "inet addr" | sed -e 's/:/ /g' | awk '{print $3}' | sed -e 's/\./ /g'`)
snmask=(`ifconfig -a eno1 | grep "inet addr" | sed -e 's/:/ /g' | awk '{print $7}' | sed -e 's/\./ /g'`)
sta=(0 0 0 0)
......@@ -25,7 +27,7 @@ if [ ! -f ./.hosts ]; then
hostlist+="$hostname "
fi
done
echo ${hostlist[*]} | sed -E 's/(cider|lexis)[0-9]{2}//g' > ./.hosts
echo ${hostlist[*]} | sed -E 's/(cider|lexis)[0-9]{2}//g' > "$hostsFile"
fi
hostlist=(`cat ./.hosts`)
hostlist=(`cat "$hostsFile"`)
echo ${hostlist[*]}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment