projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d4c3a3c
)
named.conf.local being processed right
author
Chris Koeritz
<fred@gruntose.com>
Wed, 15 Nov 2017 04:00:07 +0000
(23:00 -0500)
committer
Chris Koeritz
<fred@gruntose.com>
Wed, 15 Nov 2017 04:00:07 +0000
(23:00 -0500)
scripts/system/common_sysadmin.sh
patch
|
blob
|
history
diff --git
a/scripts/system/common_sysadmin.sh
b/scripts/system/common_sysadmin.sh
index 762609186fe80808e13fa78945f5da21fee2edd0..4bd9859a531d2d070cd832b687866542917da245 100644
(file)
--- a/
scripts/system/common_sysadmin.sh
+++ b/
scripts/system/common_sysadmin.sh
@@
-87,19
+87,19
@@
var filename seeker numlines
# don't bother looking at the lines if we're already in skip mode.
if [[ $skip_count == 0 ]]; then
# find the string they're seeking.
# don't bother looking at the lines if we're already in skip mode.
if [[ $skip_count == 0 ]]; then
# find the string they're seeking.
- if [[ !
$line =~ *${seeker}
* ]]; then
+ if [[ !
"$line" =~ .*${seeker}.
* ]]; then
# no match.
echo "$line" >> "$new_version"
else
# a match! start skipping. we will delete this line and the next N lines.
# no match.
echo "$line" >> "$new_version"
else
# a match! start skipping. we will delete this line and the next N lines.
-
$
((skip_count++))
+ ((skip_count++))
echo first skip count is now $skip_count
fi
else
# we're already skipping. let's keep going until we hit the limit.
echo first skip count is now $skip_count
fi
else
# we're already skipping. let's keep going until we hit the limit.
-
$
((skip_count++))
+ ((skip_count++))
echo ongoing skip count is now $skip_count
echo ongoing skip count is now $skip_count
- if (( $skip_count >
=
$numlines )); then
+ if (( $skip_count > $numlines )); then
echo "Done skipping, and back to writing output file."
skip_count=0
fi
echo "Done skipping, and back to writing output file."
skip_count=0
fi
@@
-127,7
+127,7
@@
function remove_zone_for_domain()
# eat the zone file definition. this will botch up badly if more text was added
# or the zone info shrank.
# eat the zone file definition. this will botch up badly if more text was added
# or the zone info shrank.
- create_chomped_copy_of_file "/etc/bind/named.conf.local" "zone*${domain_name}" 6
+ create_chomped_copy_of_file "/etc/bind/named.conf.local" "zone
.
*${domain_name}" 6
# \cp -f "$domain_file" "$domain_file.bkup-${RANDOM}"
# test_or_die "backing up domain file: $domain_file"
# \cp -f "$domain_file" "$domain_file.bkup-${RANDOM}"
# test_or_die "backing up domain file: $domain_file"
@@
-229,7
+229,7
@@
function remove_subdomain()
fi
create_chomped_copy_of_file "$domain_file" \
fi
create_chomped_copy_of_file "$domain_file" \
- "${subdomain}
*${containing_domain}*IN*A
*${IP_ADDRESS}" 1
+ "${subdomain}
.*${containing_domain} *IN *A
*${IP_ADDRESS}" 1
}
# adds a new subdomain under a containing domain.
}
# adds a new subdomain under a containing domain.