Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # You too can bring your home wherever you go.
- # Just like a snail.
- SNAIL_HOME=$HOME/.snail
- REMOTE_HOME=/tmp/snail-$USER
- test -d $SNAIL_HOME || ( echo "$SNAIL_HOME is not a directory." >/dev/stderr ; exit 1 )
- TEMPORARY_SNAIL_ARCHIVE=`mktemp`.tar.gz
- echo "SNAIL -- Making the snail's house in ${TEMPORARY_SNAIL_ARCHIVE}"
- tar -cvzf $TEMPORARY_SNAIL_ARCHIVE -C $SNAIL_HOME .
- echo "SNAIL -- Bringing the snail's house to $@"
- cat $TEMPORARY_SNAIL_ARCHIVE | ssh $@ -- "mkdir -p $REMOTE_HOME ; tar -xvzf - -C $REMOTE_HOME"
- echo "SNAIL -- Connecting to $@"
- ssh $@ -t "export HOME=$REMOTE_HOME; cd $REMOTE_HOME; exec zsh --login"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement