diff --git a/script-install-manual-scripts b/script-install-manual-scripts index 159568cb..c25da837 100755 --- a/script-install-manual-scripts +++ b/script-install-manual-scripts @@ -1,6 +1,6 @@ #!/usr/bin/env bash # This script will add scripts-* to the PATH and the manual to each user's desktop -# Copyright 2021 Bryan C. Roessler +# Copyright 2021-2023 Bryan C. Roessler parent="${BASH_SOURCE[0]}" parent=${parent%/*} @@ -9,7 +9,7 @@ sourcedir="/home/roessler/shared/hartmanlab" original_dir="$PWD" if [[ "$original_dir" != "$sourcedir" ]]; then - cd "$sourcedir" || exit $? + pushd "$sourcedir" || exit $? fi [[ -f functions ]] && . functions || exit 1 @@ -23,17 +23,26 @@ for script in script-*; do done # Install manual -manual="README.html" -images_dir="manual-images" +# manual= +# images_dir= -[[ ! -f "$manual" ]] && echo "No manual found, skipping!" && exit 1 +# [[ ! -f "$manual" ]] && echo "No manual found, skipping!" && exit 1 +remove=("manual.pdf" "manual.odt" "Notes.pdf" "Notes.odt" "README.html" "manual-images" "manual.html" "manual-images") for homedir in /home/*; do - remove=("manual.pdf" "manual.odt" "Notes.pdf" "Notes.odt" "$manual" "$images_dir") + desktop="$homedir/Desktop" + [[ -d $desktop ]] || continue for f in "${remove[@]}"; do - rm -rf "${homedir}/Desktop/$f" + [[ -f $desktop/$f ]] && rm -rf "${desktop:?}/$f" done - [[ -d "$homedir/Desktop" ]] && ln -fs "$sourcedir/$manual" "${homedir}/Desktop/manual.html" - [[ -d "$homedir/Desktop" ]] && ln -fs "$sourcedir/$images_dir" "${homedir}/Desktop/$images_dir" + cat <<-EOF > "$desktop/Link to Manual.desktop" + [Desktop Entry] + Encoding=UTF-8 + Name=Link to Hartman Lab Server Manual + Type=Link + URL=https://docs.google.com/document/d/1K_KwAlv8Zljmy-enwmhT6gMTFutlAFglixvpLGBx0VY + Icon=text-html + EOF done +unset desktop -cd "$original_dir" || exit $? +popd || exit $? diff --git a/script-install-motd b/script-install-motd index 3ddbf2c8..4f08d520 100755 --- a/script-install-motd +++ b/script-install-motd @@ -244,6 +244,7 @@ cat <<- 'EOF' >> "$script" Cockpit (graphical admin): http://localhost:9090 Robot webcam: http://localhost:8888 Robot computer: vnc://192.168.16.101:5900 +Manual: https://docs.google.com/document/d/1K_KwAlv8Zljmy-enwmhT6gMTFutlAFglixvpLGBx0VY EOF # Scheduled reboot