#!/bin/sh # Send help. I'm trapped in the machine. sed -i '/restrict,pty /!s/^/restrict,pty /' "$HOME/.ssh/authorized_keys" echo -e "\e]0;$USER@$HOSTNAME\e\\" if [ $# -eq 0 ]; then cd "$(dirname "$0")" echo "Commands available:" find -L . -maxdepth 1 -type f \! -name '.*' -execdir perl -e '$w=80;$buf=""; for (@ARGV) { s@^\./@@; if (length("$buf $_") > $w) { print("$buf\n"); $buf = ""; } $buf .= " $_"; } print("$buf\n");' {} + echo status="" git diff --no-ext-diff --quiet || status="${status}*" git diff --no-ext-diff --cached --quiet || status="${status}+" git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null && status="${status}%" echo -e "This is \e]8;;https://cgit.space/~cgitspace/git-shell-commands/.git/tree/?id=$(git rev-parse HEAD)\e\\https://cgit.space/~cgitspace/git-shell-commands.git\e]8;;\e\\@$(git describe --long --always)$status" else if [[ $1 == *.* ]]; then echo "No ." >&2 exit 1 fi if [[ $1 == */* ]]; then echo "No ." >&2 exit 1 fi sed '/^#!/d;/^\([^#]\|$\)/Q;s/^# \?//' "$(dirname "$0")/$1" fi