Skip to content

Commit

Permalink
Unified indentation style
Browse files Browse the repository at this point in the history
  • Loading branch information
oh2fih committed Jul 23, 2024
1 parent 2fa13ef commit c04f1ec
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
10 changes: 6 additions & 4 deletions bin/duplicate-ssh-hostkeys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ echo -e "\n\033[0;32mSearching duplicate hostkeys...\033[0m\n" >&2

hostkeys=$(grep "debug1: Server host key" "$tmpdir"/ssh-*.log)

duplicatekeys=$(echo "$hostkeys" \
| awk '{ print $5" "$6; }' \
| sort \
| uniq -d)
duplicatekeys=$(
echo "$hostkeys" \
| awk '{ print $5" "$6; }' \
| sort \
| uniq -d
)

if [ -n "$duplicatekeys" ]; then
echo -e "Duplicate host keys found in ${1}!\n"
Expand Down
4 changes: 2 additions & 2 deletions bin/find-inactive-ssh-sessions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ fi
echo "" >&2

# Get TTYs with the seconds since the last access time
TTY_AGES=$( \
TTY_AGES=$(
who -s | awk '{ print $2 }' \
| (cd /dev && xargs stat -c '%U %n %X') \
| awk '{ print $1"\t"$2"\t"'"$(date +%s)"'-$3 }'
)
)

# Get sshd processes of the TTYs; print or kill (-k)
while IFS= read -r line ; do
Expand Down
2 changes: 1 addition & 1 deletion bin/git-find-commits-by-file-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ matches=$(
| awk '{print $1}' \
| print_commit_and_checksum "$2" \
| grep -E "[0-9a-f]*:${1}"
)
)

if [[ "$matches" =~ [0-9a-f]+ ]]; then
echo "$matches" \
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TOINSTALL=$(
"Choose the Misc-Scripts to be installed,\nbin => ${BIN}" \
"$HEIGHT" "$WIDTH" "$MENUCOUNT" \
"${MENULIST[@]}" 3>&1 1>&2 2>&3
)
)
exitstatus=$?
if [ "$exitstatus" -ne 0 ]; then
printf "Aborting...\n"
Expand Down Expand Up @@ -83,7 +83,7 @@ TOINSTALL+=$(
"Choose the Misc-Scripts to be installed,\nsbin => ${SBIN}" \
"$HEIGHT" "$WIDTH" "$MENUCOUNT" \
"${MENULIST[@]}" 3>&1 1>&2 2>&3
)
)
exitstatus=$?
if [ "$exitstatus" -ne 0 ]; then
printf "Aborting...\n"
Expand Down
2 changes: 1 addition & 1 deletion sbin/backup-mysql-databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ date=$(date "+${DatePattern}")
databases=$(
mysql -N -B -e "SHOW DATABASES;" \
| grep -E -v "$ExcludeDatabases"
)
)

echo "Working directory: $(pwd)"
echo "Excluding databases: ${ExcludeDatabases}"
Expand Down
6 changes: 4 additions & 2 deletions sbin/create-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ letsencrypt_hostnames=""
hostname_errors=0

for hostname in "${@:2}"; do
validated_hostname=$(echo "$hostname" \
| grep -P '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)')
validated_hostname=$(
echo "$hostname" \
| grep -P '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)'
)
if [ -z "$validated_hostname" ]; then
echo "*** ERROR! $hostname is not valid!"
((hostname_errors=hostname_errors+1))
Expand Down

0 comments on commit c04f1ec

Please sign in to comment.