make regex take care of double digits
This commit is contained in:
parent
544f7d2fa4
commit
dea32e0fd0
16
iso/empanadas/empanadas/templates/verifygpg.tmpl
Normal file
16
iso/empanadas/empanadas/templates/verifygpg.tmpl
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o pipefail
|
||||||
|
{{ import_gpg_cmd }} | tee -a {{ sync_log }}
|
||||||
|
{{ arch_force_cp }} | tee -a {{ sync_log }}
|
||||||
|
{{ dnf_plugin_cmd }} | tee -a {{ sync_log }}
|
||||||
|
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*.repo
|
||||||
|
|
||||||
|
LISTS=( $({{ dnf_url_cmd }} | grep '.rpm$' | tee -a {{ sync_log }}) )
|
||||||
|
|
||||||
|
ret_val=$?
|
||||||
|
if [ "$ret_val" -ne 0 ]; then
|
||||||
|
echo "Pulling URL's failed" | tee -a {{ sync_log }}
|
||||||
|
echo "It is likely the repo is not GPG signed properly." | tee -a {{ sync_log }}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
@ -21,7 +21,9 @@ SOURCE_AMI_NAME=$(aws --profile resf-ami ec2 describe-images \
|
|||||||
|
|
||||||
# Enforce a name structure
|
# Enforce a name structure
|
||||||
# Rocky-8-ec2-8.6-20220515.0.x86_64
|
# Rocky-8-ec2-8.6-20220515.0.x86_64
|
||||||
pat="Rocky-[89]-[Ee][Cc]2-[89]\.[0-9]-[0-9]+\.[0-9]+\.((aarch|x86_)64|ppc64le|s390x)"
|
# Rocky-9-EC2-9.10-20280501.0.aarch64
|
||||||
|
# Rocky-10-EC2-10.2-20260530.0.x86_64
|
||||||
|
pat="Rocky-[0-9]{,2}-[Ee][Cc]2-[0-9]{,2}\.[0-9]{,2}-[0-9]+\.[0-9]+\.((aarch|x86_)64|ppc64le|s390x)"
|
||||||
if [[ ! "${SOURCE_AMI_NAME}" =~ $pat ]]; then
|
if [[ ! "${SOURCE_AMI_NAME}" =~ $pat ]]; then
|
||||||
echo "Bad source ami (${SOURCE_AMI_NAME}). Exiting."
|
echo "Bad source ami (${SOURCE_AMI_NAME}). Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user