Skip to content

Commit

Permalink
Making AULS shellcheck compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
equetzal committed Aug 1, 2023
1 parent 03d00d5 commit 15a94da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions base-system/usrroot/usr/sbin/auls
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
# Authors:
# Enya Quetzalli <[email protected]>

STACK_ID="$(cat /proc/mounts | grep 'aufs / aufs' | egrep -o 'si=([^,) ]+)' | tr = _)"
# shellcheck disable=SC2010
STACK_ID="$(grep 'aufs / aufs' < /proc/mounts | grep -oE 'si=([^,) ]+)' | tr '=' '_')"
BRANCHES_DIR="/sys/fs/aufs/${STACK_ID}"
BRANCHES_LIST="$(ls -v1 $BRANCHES_DIR | grep -E "br[0-9]+")"
BRANCHES_LIST="$(ls -v1 "$BRANCHES_DIR" | grep -E "br[0-9]+")"

for BR in $BRANCHES_LIST; do
printf "%-5.5s\t%-50.50s\t%s\n" "${BR}" "$(cat $BRANCHES_DIR/$BR)" "$(cat /proc/mounts | grep $(cat $BRANCHES_DIR/$BR | cut -d= -f1) | tail -n 1 | awk '{print $1}')"
printf "%-5.5s\t%-50.50s\t%s\n" "${BR}" "$(cat "$BRANCHES_DIR"/"$BR")" "$(grep "$(cut -d= -f1 < "$BRANCHES_DIR"/"$BR")" < /proc/mounts | tail -n 1 | awk '{print $1}')"
done

0 comments on commit 15a94da

Please sign in to comment.