Files
hartman-server/script-install-manual-scripts
2023-04-07 11:18:48 -04:00

44 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# This script will add scripts-* to the PATH and the manual to each user's desktop
# Copyright 2021-2023 Bryan C. Roessler
parent="${BASH_SOURCE[0]}"
parent=${parent%/*}
sourcedir="/home/roessler/shared/hartmanlab"
original_dir="$PWD"
if [[ "$original_dir" != "$sourcedir" ]]; then
pushd "$sourcedir" || exit $?
fi
[[ -f functions ]] && . functions || exit 1
is_root
install -m 644 ./functions /usr/local/bin/
for script in script-*; do
cp -u "$script" /usr/local/bin/
done
# Install manual link
remove=("manual.pdf" "manual.odt" "Notes.pdf" "Notes.odt" "README.html" "manual-images" "manual.html" "manual-images")
for homedir in /home/*; do
desktop="$homedir/Desktop"
[[ -d $desktop ]] || continue
for f in "${remove[@]}"; do
[[ -f $desktop/$f ]] && rm -rf "${desktop:?}/$f"
done
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