Dzahn has submitted this change and it was merged. Change subject: mgmt: fix-up grep regex in getmgmtips ......................................................................
mgmt: fix-up grep regex in getmgmtips Change the grep regex to include names with a "-" dash character in them. Always delete the tmp files on startup. Change-Id: Ib4a710e17163f9318d2f367aeb2d762d3a634d85 --- M modules/mgmt/files/getmgmtips 1 file changed, 6 insertions(+), 10 deletions(-) Approvals: Dzahn: Verified; Looks good to me, approved diff --git a/modules/mgmt/files/getmgmtips b/modules/mgmt/files/getmgmtips index 1cbc685..9d04a04 100644 --- a/modules/mgmt/files/getmgmtips +++ b/modules/mgmt/files/getmgmtips @@ -14,15 +14,11 @@ echo "getting all mgmt hostnames from DNS templates.." -if [ ! -d "$tempdir" ]; then - echo "creating temp dir $tempdir and git cloning DNS repo.." - mkdir -p $tempdir - cd $tempdir - git clone $dnsrepo -else - echo "removing $tempdir" - rm -rf $tempdir -fi +rm -rf $tempdir +echo "creating temp dir $tempdir and git cloning DNS repo.." +mkdir -p $tempdir +cd $tempdir +git clone $dnsrepo cd ${tempdir}/dns/templates @@ -32,7 +28,7 @@ fi echo -e "extracting mgmt hostnames from 10.in-addr.arpa..\n" -mgmt_hosts=$(grep -oh "\w*.mgmt.\w*.\w*.\w*" 10.in-addr.arpa) +mgmt_hosts=$(grep -o '[a-z].*\.mgmt\.[a-z].*' 10.in-addr.arpa) touch $resulfile.tmp touch $rejectfile.tmp -- To view, visit https://gerrit.wikimedia.org/r/319483 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4a710e17163f9318d2f367aeb2d762d3a634d85 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn <dz...@wikimedia.org> Gerrit-Reviewer: Dzahn <dz...@wikimedia.org> Gerrit-Reviewer: Papaul <ptshiba...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits