diff --git a/sshrc b/sshrc index 3314ddf..a17b968 100755 --- a/sshrc +++ b/sshrc @@ -7,7 +7,7 @@ function _sshrc() { if [ -d $SSHHOME/.sshrc.d ]; then files="$files .sshrc.d" fi - SIZE=$(tar cfz - -h -C $SSHHOME $files | wc -c) + SIZE=$( { cd $SSHHOME; tar cf - -h $files; } | gzip | wc -c ) if [ $SIZE -gt 65536 ]; then echo >&2 $'.sshrc.d and .sshrc files must be less than 64kb\ncurrent size: '$SIZE' bytes' exit 1 @@ -59,7 +59,7 @@ EOF )"' | tr -s ' ' $'\n' | openssl enc -base64 -d > \$SSHHOME/bashsshrc chmod +x \$SSHHOME/bashsshrc - echo $'"$(tar czf - -h -C $SSHHOME $files | openssl enc -base64)"' | tr -s ' ' $'\n' | openssl enc -base64 -d | tar mxzf - -C \$SSHHOME + echo $'"$( { cd $SSHHOME; tar cf - -h $files; } | gzip | openssl enc -base64)"' | tr -s ' ' $'\n' | openssl enc -base64 -d | gunzip | { cd \$SSHHOME; tar mxf -; } export SSHHOME=\$SSHHOME echo \"$CMDARG\" >> \$SSHHOME/sshrc.bashrc bash --rcfile \$SSHHOME/sshrc.bashrc