#!/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" "Link to Manual.desktop" "manual-images" "manual.html" "manual-images" "Manual.desktop" "manual.desktop") 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/manual.desktop" [Desktop Entry] Encoding=UTF-8 Name=Hartman Lab Server Manual Type=Link URL=https://docs.google.com/document/d/1K_KwAlv8Zljmy-enwmhT6gMTFutlAFglixvpLGBx0VY Icon=text-html EOF done unset desktop