Update manual deploy

This commit is contained in:
2023-04-07 11:15:04 -04:00
parent 49365cb712
commit e8311ddd21
2 changed files with 20 additions and 10 deletions

View File

@@ -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 $?

View File

@@ -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