Corrected command for byte count.

- used awk to return only the first column of the output from wc, which is the numerical part.
This commit is contained in:
Doc
2025-12-14 21:08:14 -05:00
parent ae8c5d9c3e
commit 21b3784006

View File

@@ -107,7 +107,7 @@ cat << EOF
EOF EOF
if [ -f "$ANSIUSERDIR/.ssh/authorized_keys" ]; then if [ -f "$ANSIUSERDIR/.ssh/authorized_keys" ]; then
BEFORESZ=$(wc -c "$ANSIUSERDIR/.ssh/authorized_keys") BEFORESZ=$(wc -c "$ANSIUSERDIR/.ssh/authorized_keys" | awk '//{ print $1 }')
else else
BEFORESZ=0 BEFORESZ=0
fi fi
@@ -116,7 +116,7 @@ cat >> $ANSIUSERDIR/.ssh/authorized_keys
err=$? err=$?
if [ -f "$ANSIUSERDIR/.ssh/authorized_keys" ]; then if [ -f "$ANSIUSERDIR/.ssh/authorized_keys" ]; then
AFTERSZ=$(wc -c "$ANSIUSERDIR/.ssh/authorized_keys") AFTERSZ=$(wc -c "$ANSIUSERDIR/.ssh/authorized_keys" | awk '//{ print $1 }')
if [ ! $AFTERSZ -gt $BEFORESZ ]; then if [ ! $AFTERSZ -gt $BEFORESZ ]; then
cat << EOF cat << EOF