Remove decorative emojis from README headers and script output for improved consistency
This commit is contained in:
@@ -112,7 +112,7 @@ fi
|
||||
|
||||
# Warn if non-empty to avoid masking existing files
|
||||
if [[ -n "$(ls -A -- "$MOUNTPOINT" 2>/dev/null || true)" ]]; then
|
||||
echo "⚠️ Mount point '$MOUNTPOINT' is not empty; its contents will be hidden while mounted." >&2
|
||||
echo "Mount point '$MOUNTPOINT' is not empty; its contents will be hidden while mounted." >&2
|
||||
fi
|
||||
|
||||
# --- split remote user/host (supports user:host or user@host) ---
|
||||
@@ -144,7 +144,7 @@ if mountpoint -q -- "$MOUNTPOINT"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔗 Mounting '$FOLDER' from '$REMOTE_USER@$REMOTE_HOST' via reverse-tunnel localhost:$PORT → '$MOUNTPOINT' ..."
|
||||
echo "Mounting '$FOLDER' from '$REMOTE_USER@$REMOTE_HOST' via reverse-tunnel localhost:$PORT → '$MOUNTPOINT' ..."
|
||||
|
||||
# --- ensure passwordless auth via tunnel (optional but user-friendly) ---
|
||||
# Purpose: detect whether a dedicated identity exists and hint user if passwordless setup is missing.
|
||||
@@ -160,7 +160,7 @@ fi
|
||||
|
||||
if ! ssh -o BatchMode=yes -o StrictHostKeyChecking="$HKP" \
|
||||
-p "$PORT" "${SSH_IDENTITY_OPTS[@]}" "$REMOTE_USER@localhost" true 2>/dev/null; then cat >&2 <<EOF
|
||||
⚠️ Passwordless auth not set for $REMOTE_USER@localhost:$PORT.
|
||||
Passwordless auth not set for $REMOTE_USER@localhost:$PORT.
|
||||
You can initialize a tunnel-only, SFTP-only key with:
|
||||
backtunnel-auth-setup -p $PORT $REMOTE_USER@localhost
|
||||
(It will ask once for the server password to install and restrict the key.)
|
||||
@@ -173,8 +173,8 @@ echo "Checking remote path visibility via SFTP ..."
|
||||
# Purpose: quick sanity check that the target path is visible over SFTP before mounting.
|
||||
if ! sftp -q -P "$PORT" -o StrictHostKeyChecking="$HKP" "${SFTP_ID_OPTS[@]}" \
|
||||
"$REMOTE_USER@localhost" <<< "ls -1 \"$FOLDER\"" >/dev/null 2>&1; then
|
||||
echo "⚠️ Remote path '$FOLDER' not listable via SFTP. It may not exist or permissions deny access." >&2
|
||||
echo " Proceeding to mount; sshfs may fail if the path is invalid." >&2
|
||||
echo "Remote path '$FOLDER' not listable via SFTP. It may not exist or permissions deny access." >&2
|
||||
echo "Proceeding to mount; sshfs may fail if the path is invalid." >&2
|
||||
fi
|
||||
|
||||
# Build ssh command used by sshfs (adds keepalive/connect-timeout, identity if present).
|
||||
@@ -196,5 +196,5 @@ sshfs \
|
||||
-o ssh_command="$SSH_CMD" \
|
||||
-- "$REMOTE_USER@localhost:$FOLDER" "$MOUNTPOINT"
|
||||
|
||||
echo "✅ Mounted at: $MOUNTPOINT"
|
||||
echo "Mounted at: $MOUNTPOINT"
|
||||
echo "To unmount: backtunnel-umount \"$MOUNTPOINT\""
|
||||
|
||||
@@ -440,7 +440,7 @@ fi
|
||||
# Banner
|
||||
# Purpose: inform the user what will happen and where to connect from the remote.
|
||||
# ----------------------------
|
||||
echo "⏳ Sharing '${FOLDER}' via reverse SSH:"
|
||||
echo "Sharing '${FOLDER}' via reverse SSH:"
|
||||
echo " local sshd port : ${LOCAL_SSH_PORT}"
|
||||
echo " remote bind port : ${TUNNEL_PORT} (on ${REMOTE_HOST})"
|
||||
echo " remote user : ${REMOTE_USER}"
|
||||
@@ -488,7 +488,7 @@ EOT
|
||||
)
|
||||
fi
|
||||
|
||||
echo "🔗 Invite (copy to chat):"
|
||||
echo "Invite (copy to chat):"
|
||||
echo "------------------------------------------------------------"
|
||||
[[ -n "$AUTH_CMD" ]] && echo "${AUTH_CMD}"
|
||||
echo "${INVITE_CMD}"
|
||||
@@ -501,10 +501,10 @@ EOT
|
||||
if $QR; then
|
||||
if command -v qrencode >/dev/null 2>&1; then
|
||||
echo
|
||||
echo "📱 QR (scan to copy the command):"
|
||||
echo "QR (scan to copy the command):"
|
||||
printf "%s" "${INVITE_CMD}" | qrencode -t ansiutf8
|
||||
else
|
||||
echo "⚠️ 'qrencode' not installed; skipping QR."
|
||||
echo "'qrencode' not installed; skipping QR."
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
@@ -521,7 +521,7 @@ echo "To stop sharing early: press Ctrl+C in this window."
|
||||
# ----------------------------
|
||||
if ssh -o BatchMode=yes -o StrictHostKeyChecking="$HKP" -o ConnectTimeout=5 "${REMOTE_USER}@${REMOTE_HOST}" \
|
||||
"command -v nc >/dev/null 2>&1 && nc -z 127.0.0.1 ${TUNNEL_PORT}"; then
|
||||
echo "⚠️ Port ${TUNNEL_PORT} on remote 127.0.0.1 appears in use; choose another with -p." >&2
|
||||
echo "Port ${TUNNEL_PORT} on remote 127.0.0.1 appears in use; choose another with -p." >&2
|
||||
# You may 'exit 1' here if you prefer a hard failure
|
||||
fi
|
||||
|
||||
@@ -538,7 +538,7 @@ SSH_PID=""
|
||||
cleanup() {
|
||||
# stop ssh child if running
|
||||
if [[ -n "${SSH_PID:-}" ]] && kill -0 "$SSH_PID" 2>/dev/null; then
|
||||
echo "⏹️ Stopping share..."
|
||||
echo "Stopping share..."
|
||||
kill -TERM "$SSH_PID" 2>/dev/null || true
|
||||
wait "$SSH_PID" 2>/dev/null || true
|
||||
fi
|
||||
@@ -565,7 +565,7 @@ if timeout "$DURATION" tail --pid="$SSH_PID" -f /dev/null; then
|
||||
else
|
||||
rc=$?
|
||||
if [[ $rc -eq 124 ]]; then
|
||||
echo "⏹️ Sharing ended: reached duration (${DURATION})."
|
||||
echo "Sharing ended: reached duration (${DURATION})."
|
||||
# ensure the child is gone
|
||||
if kill -0 "$SSH_PID" 2>/dev/null; then
|
||||
kill -TERM "$SSH_PID" 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user