From da8b091d08c731d798c522b1cb08e59c48e348cc Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 18 Apr 2024 02:28:33 -0400 Subject: [PATCH] minor fixes --- mount-latest-remote | 4 ++-- ssh-emacs-setup | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mount-latest-remote b/mount-latest-remote index 3363311..f63a6f7 100755 --- a/mount-latest-remote +++ b/mount-latest-remote @@ -26,8 +26,8 @@ set -e; . /usr/local/lib/bash-bear; set +e -readonly this_file; this_file="$(readlink -f -- "${BASH_SOURCE[0]}")"; -script_dir=${this_file%/*} +this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" +readonly this_file script_dir="${this_file%/*}" if (( ! $# )); then echo "mount-latest-remote: error: a host argument" diff --git a/ssh-emacs-setup b/ssh-emacs-setup index b89f2bd..309ab0a 100755 --- a/ssh-emacs-setup +++ b/ssh-emacs-setup @@ -32,7 +32,9 @@ if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR -readonly this_file; this_file="$(readlink -f -- "${BASH_SOURCE[0]}")"; cd ${this_file%/*} +this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" +readonly this_file this_dir="${this_file%/*}" +cd "$this_dir" # get rid of useless motd stuff sed -i --follow-symlinks 's/^\s*PrintLastLog .*/PrintLastLog no/' /etc/ssh/sshd_config rm -f /etc/update-motd.d/10-help-text /etc/update-motd.d/00-header -- 2.30.2