Fixed indentation
This commit is contained in:
parent
567afc73a6
commit
0f4e699eca
|
@ -37,19 +37,18 @@ function hostname {
|
|||
|
||||
while [ "$HOST_OK" = false ]
|
||||
do
|
||||
|
||||
echo "Is ${HOST} correct?"
|
||||
select yn in "Yes" "No";
|
||||
do
|
||||
case $yn in
|
||||
Yes )
|
||||
ok=true
|
||||
HOST_OK=true;
|
||||
break;;
|
||||
No )
|
||||
ok=false
|
||||
break;;
|
||||
esac
|
||||
case $yn in
|
||||
Yes )
|
||||
ok=true
|
||||
HOST_OK=true;
|
||||
break;;
|
||||
No )
|
||||
ok=false
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$ok" = false ]; then
|
||||
|
@ -60,29 +59,29 @@ function hostname {
|
|||
}
|
||||
|
||||
function escape_slashes {
|
||||
sed 's/\//\\\//g'
|
||||
sed 's/\//\\\//g'
|
||||
}
|
||||
|
||||
function change_line {
|
||||
local OLD_LINE_PATTERN=$1; shift
|
||||
local NEW_LINE=$1; shift
|
||||
local FILE=$1
|
||||
local OLD_LINE_PATTERN=$1; shift
|
||||
local NEW_LINE=$1; shift
|
||||
local FILE=$1
|
||||
|
||||
local NEW=$(echo "${NEW_LINE}" | escape_slashes)
|
||||
sed -i '/'"${OLD_LINE_PATTERN}"'/s/.*/'"${NEW}"'/' "${FILE}"
|
||||
local NEW=$(echo "${NEW_LINE}" | escape_slashes)
|
||||
sed -i '/'"${OLD_LINE_PATTERN}"'/s/.*/'"${NEW}"'/' "${FILE}"
|
||||
}
|
||||
|
||||
while getopts ":n:fh" opt; do
|
||||
case $opt in
|
||||
n) HOST=$OPTARG;;
|
||||
f) force=true;;
|
||||
h) showhelp
|
||||
h) showhelp
|
||||
exit 0 ;;
|
||||
\?) echo -e "\nERROR:invalid option: -$OPTARG";
|
||||
showhelp;
|
||||
echo -e "\naborting.\n"
|
||||
exit 1 >&2 ;;
|
||||
esac
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $force ]; then
|
||||
|
|
Loading…
Reference in New Issue