mirror of
https://git.dn42.dev/dn42/registry.git
synced 2024-11-11 13:27:10 +01:00
run shellcheck on helper scripts
fmt-my-stuff: #3595 squash-my-commits: __future__ fix shellcheck warnings on fmt-my-stuff and squash-my-commits
This commit is contained in:
parent
1f76bc5adb
commit
87b641814f
@ -11,8 +11,8 @@ BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.r
|
||||
BASE="$(dirname "$BASE")"
|
||||
cd "$BASE" || exit 1
|
||||
|
||||
git diff --name-only $1 | while IFS='/' read -ra LINE; do
|
||||
git diff --name-only "$1" | while IFS='/' read -ra LINE; do
|
||||
if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then
|
||||
utils/schema-check/dn42-schema.py -v policy ${LINE[1]} ${LINE[2]} $2
|
||||
utils/schema-check/dn42-schema.py -v policy "${LINE[1]}" "${LINE[2]}" "$2"
|
||||
fi
|
||||
done
|
||||
|
@ -11,8 +11,8 @@ BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.r
|
||||
BASE="$(dirname "$BASE")"
|
||||
cd "$BASE" || exit 1
|
||||
|
||||
git diff --name-only $1 | while IFS='/' read -ra LINE; do
|
||||
git diff --name-only "$1" | while IFS='/' read -ra LINE; do
|
||||
if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then
|
||||
utils/schema-check/dn42_schema_local.py -v policy ${LINE[1]} ${LINE[2]} $2
|
||||
utils/schema-check/dn42_schema_local.py -v policy "${LINE[1]}" "${LINE[2]}" "$2"
|
||||
fi
|
||||
done
|
||||
|
@ -9,4 +9,7 @@ fi
|
||||
BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")"
|
||||
BASE="$(dirname "$BASE")"
|
||||
|
||||
grep -lrE "(\s|:)$1(\s|\$)" "$BASE/data/" | while read line; do utils/schema-check/dn42-schema.py fmt -i "$line"; done
|
||||
grep -lrE "(\s|:)$1(\s|\$)" "$BASE/data/" | while read -r line; do
|
||||
utils/schema-check/dn42-schema.py fmt -i "$line"
|
||||
done
|
||||
|
||||
|
@ -68,8 +68,7 @@ done
|
||||
##########################################################################
|
||||
|
||||
# check for dn42registry remote, and add if missing
|
||||
git remote -v | grep dn42registry > /dev/null 2>&1
|
||||
if [ "$?" -ne 0 ]
|
||||
if ! git remote -v | grep dn42registry > /dev/null 2>&1
|
||||
then
|
||||
|
||||
# was the URL specified directly ?
|
||||
@ -81,8 +80,7 @@ then
|
||||
if [ -z "$reg_proto" ]
|
||||
then
|
||||
# if the proto wasn't forced, try to guess it
|
||||
git remote -v | grep 'https' > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]
|
||||
if git remote -v | grep 'https' > /dev/null 2>&1
|
||||
then
|
||||
reg_proto='https'
|
||||
else
|
||||
@ -112,8 +110,7 @@ fi
|
||||
|
||||
# ensure the local branch is up to date
|
||||
echo "Fetching dn42registry master"
|
||||
git fetch dn42registry master
|
||||
if [ $? -ne 0 ]
|
||||
if ! git fetch dn42registry master
|
||||
then
|
||||
echo 'ERROR: Failed to fetch registry master branch'
|
||||
echo 'Hint: you can use --ssh/--https to force use of ssh or https'
|
||||
@ -123,8 +120,7 @@ then
|
||||
fi
|
||||
|
||||
# find number of local commits
|
||||
count=$(git rev-list --count HEAD ^dn42registry/master)
|
||||
if [ $? -ne 0 ]
|
||||
if ! count=$(git rev-list --count HEAD ^dn42registry/master)
|
||||
then
|
||||
echo "ERROR: Failed to find the number of local commits"
|
||||
echo "Please report this as a bug to the registry maintainters"
|
||||
@ -160,7 +156,7 @@ $(git log --oneline HEAD ^dn42registry/master)"
|
||||
|
||||
# and finally squash
|
||||
git reset --soft dn42registry/master
|
||||
git commit $do_sign -m "$comment"
|
||||
git commit "$do_sign" -m "$comment"
|
||||
|
||||
# show what happened
|
||||
echo '---'
|
||||
|
@ -14,8 +14,8 @@ fix_dns() {
|
||||
{
|
||||
set -e
|
||||
echo "domain: ${DST}"
|
||||
cat "${TMP}" | grep -E '^(remarks):' || true
|
||||
cat "data/dns/${SRC}" | grep '^nserver:' | tr -s " " | cut -d' ' -f2 | sort | uniq | xargs -i echo 'nserver: {}'
|
||||
grep -E '^(remarks):' "${TMP}" || true
|
||||
grep '^nserver:' "data/dns/${SRC}" | tr -s " " | cut -d' ' -f2 | sort | uniq | xargs -I{} echo 'nserver: {}'
|
||||
drill -t "${DST}" "@${DS_NSERVER}" DNSKEY -s | grep sha256 | cut -d: -f2 | sed -E 's/^ [^\t ]+\t900\tIN\tDS\t/ds-rdata: /g' | grep -E "${KSK_PATTERN}"
|
||||
echo 'org: ORG-DN42'
|
||||
echo 'mnt-by: DN42-MNT'
|
||||
@ -35,7 +35,7 @@ fix_inetnum() {
|
||||
sed -r -i '/^(nserver|ds-rdata|status|org|policy|mnt-by|source|admin-c|tech-c):.*$/d' "data/${CLASS}/${DST}"
|
||||
{
|
||||
set -e
|
||||
cat "data/dns/${SRC}" | grep '^nserver:' | tr -s " " | cut -d' ' -f2 | sort | uniq | xargs -i echo 'nserver: {}'
|
||||
grep '^nserver:' "data/dns/${SRC}" | tr -s " " | cut -d' ' -f2 | sort | uniq | xargs -I{} echo 'nserver: {}'
|
||||
drill -t "${DNS_NAME}" "@${DS_NSERVER}" DNSKEY -s | grep sha256 | cut -d: -f2 | sed -E 's/^ [^\t ]+\t900\tIN\tDS\t/ds-rdata: /g' | grep -E "${KSK_PATTERN}"
|
||||
echo 'status: ALLOCATED'
|
||||
echo "policy: ${POLICY}"
|
||||
@ -54,7 +54,7 @@ fix_dns_ds_only() {
|
||||
{
|
||||
set -e
|
||||
echo "domain: ${DST}"
|
||||
cat "${TMP}" | grep -E '^(nserver|remarks):' || true
|
||||
grep -E '^(nserver|remarks):' "${TMP}" || true
|
||||
drill -t "${DST}" "@${DS_NSERVER}" DNSKEY -s | grep sha256 | cut -d: -f2 | sed -E 's/^ [^\t ]+\t900\tIN\tDS\t/ds-rdata: /g' | grep -E "${KSK_PATTERN}"
|
||||
echo 'org: ORG-DN42'
|
||||
echo 'mnt-by: DN42-MNT'
|
Loading…
Reference in New Issue
Block a user