Skip to content

Commit

Permalink
Merge pull request #14 from Dunedan/add-shellcheck-hook
Browse files Browse the repository at this point in the history
Add a ShellCheck pre-commit hook
  • Loading branch information
Dunedan authored Dec 11, 2023
2 parents 0c14e6f + 1bc2efd commit b9616b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ repos:
rev: v6.14.2
hooks:
- id: ansible-lint

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
2 changes: 1 addition & 1 deletion roles/borgmatic/files/dump-ejabberd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ "$PRIVATE_TMP_BACKUP_LOCATION" = "" ]; then
exit 1
fi

if [ $(echo "$PRIVATE_TMP_BACKUP_LOCATION" | wc -l) -gt 1 ]; then
if [ "$(echo "$PRIVATE_TMP_BACKUP_LOCATION" | wc -l)" -gt 1 ]; then
echo "Something went wrong. Found more than one backup."
exit 1
fi
Expand Down
10 changes: 5 additions & 5 deletions roles/ejabberd/files/create-self-signed-ejabberd-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ keyUsage=digitalSignature
extendedKeyUsage=serverAuth"
EOF

openssl req -x509 -out $TMP_DIR/$DOMAIN.crt -keyout $TMP_DIR/$DOMAIN.key \
openssl req -x509 -out "$TMP_DIR/$DOMAIN.crt" -keyout "$TMP_DIR/$DOMAIN.key" \
-newkey rsa:2048 -nodes -sha256 -days 90 \
-subj "/CN=$DOMAIN" -extensions EXT -config "$TMP_DIR/config"

cat $TMP_DIR/$DOMAIN.key > $TMP_DIR/$DOMAIN.pem
cat $TMP_DIR/$DOMAIN.crt >> $TMP_DIR/$DOMAIN.pem
cat "$TMP_DIR/$DOMAIN.key" > "$TMP_DIR/$DOMAIN.pem"
cat "$TMP_DIR/$DOMAIN.crt" >> "$TMP_DIR/$DOMAIN.pem"

chgrp ejabberd $TMP_DIR/$DOMAIN.pem
chgrp ejabberd "$TMP_DIR/$DOMAIN.pem"

mv $TMP_DIR/$DOMAIN.pem $TARGET_DIR/$DOMAIN.pem
mv "$TMP_DIR/$DOMAIN.pem" "$TARGET_DIR/$DOMAIN.pem"

0 comments on commit b9616b2

Please sign in to comment.