check if remote path exists
This commit is contained in:
parent
5041acdf5c
commit
dbd6bbd561
|
@ -203,7 +203,9 @@ function zvm_after_init() {
|
||||||
echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID"
|
echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID"
|
||||||
fi
|
fi
|
||||||
if [ "$REMOTE_PATH" != "" ]; then
|
if [ "$REMOTE_PATH" != "" ]; then
|
||||||
cd "$REMOTE_PATH"
|
if [ -d "$REMOTE_PATH" ]; then
|
||||||
|
cd "$REMOTE_PATH"
|
||||||
|
fi
|
||||||
elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
|
elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
|
||||||
cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
|
cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue