Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make script better #17

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ echo "Running STRFile on normal fortunes..."
strfile mythical_linux
echo "Running STRFile on offensive fortunes..."
strfile off/mythical_linux
if test -d /usr/share/fortune; then
echo "Copying normal fortunes to /usr/share/fortune..."
sudo cp mythical_linux{,.dat} /usr/share/fortune
echo "Copying offensive fortunes to /usr/share/fortune/off..."
sudo cp off/mythical_linux{,.dat} /usr/share/fortune/off
echo "Permission-fixing fortunes at /usr/share/fortune..."
sudo chmod 777 -R /usr/share/fortune
elif test -d /usr/share/fortunes; then
echo "Copying normal fortunes to /usr/share/fortunes..."
sudo cp mythical_linux{,.dat} /usr/share/fortunes
echo "Copying offensive fortunes to /usr/share/fortunes/off..."
sudo cp off/mythical_linux{,.dat} /usr/share/fortunes/off
echo "Permission-fixing fortunes at /usr/share/fortunes..."
sudo chmod 777 -R /usr/share/fortunes
fi
dir="$(whereis fortune | awk -F\ '{ print $3 }')"
echo "Copying normal fortunes to $dir..."
sudo cp mythical_linux{,.dat} "$dir"
echo "Copying offensive fortunes to $dir/off..."
sudo cp off/mythical_linux{,.dat} "$dir/off"
echo "Permission-fixing fortunes at $dir..."
sudo chmod 777 -R "$dir"
echo "Fortunes installed."