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:
@@ -107,7 +107,7 @@ cat << EOF
|
||||
EOF
|
||||
|
||||
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
|
||||
BEFORESZ=0
|
||||
fi
|
||||
@@ -116,7 +116,7 @@ cat >> $ANSIUSERDIR/.ssh/authorized_keys
|
||||
err=$?
|
||||
|
||||
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
|
||||
cat << EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user