32 lines
861 B
Bash
Executable File
32 lines
861 B
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 Bryan C. Roessler
|
|
|
|
parent="${BASH_SOURCE[0]}"
|
|
parent=${parent%/*}
|
|
|
|
[[ -f "$parent"/functions ]] && . "$parent"/functions || exit 1
|
|
|
|
is_root
|
|
|
|
#git rev-parse --is-inside-git-dir || echo "You must execute this script from the hartmanlab git directory" && exit 1
|
|
|
|
install -m 644 "$parent"/functions /usr/local/bin/
|
|
|
|
for script in "$parent"/script-*; do
|
|
cp -f "$script" /usr/local/bin/
|
|
done
|
|
|
|
# Install manual
|
|
manual="$parent/README.html"
|
|
|
|
[[ ! -f "$manual" ]] && echo "No manual found, skipping!" && exit 1
|
|
for homedir in /home/*; do
|
|
remove=("manual.pdf" "manual.odt" "Notes.pdf" "Notes.odt" "$manual")
|
|
for f in "${remove[@]}"; do
|
|
rm -f "${homedir}/Desktop/$f"
|
|
done
|
|
ln -fs "$manual" "${homedir}/Desktop/$manual"
|
|
done
|
|
|