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
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user