-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Phate6660/patch-1
Update install.sh
- Loading branch information
Showing
1 changed file
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
#!/bin/bash | ||
# Makes and copies normal and offensive fortunes and their data to /usr/share/fortune | ||
echo "Running STRFile on normal fortunes..." | ||
strfile mythical_linux | ||
echo "Running STRFile on offensive fortunes..." | ||
strfile off/mythical_linux | ||
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." | ||
non() { | ||
echo "Running STRFile on normal fortunes..." | ||
strfile mythical_linux | ||
echo "Copying normal fortunes to $dir..." | ||
sudo cp mythical_linux{,.dat} "$dir" | ||
} | ||
off() { | ||
echo "Running STRFile on offensive fortunes..." | ||
strfile off/mythical_linux | ||
echo "Copying offensive fortunes to $dir/off..." | ||
sudo cp off/mythical_linux{,.dat} "$dir/off" | ||
} | ||
post() { | ||
echo "Permission-fixing fortunes at $dir..." | ||
sudo chmod 777 -R "$dir" | ||
echo "Fortunes installed." && exit 0 | ||
} | ||
case $1 in | ||
h) echo " | ||
n = install non-offensive | ||
o = install offensive | ||
no arguments = install both | ||
" | ||
;; | ||
n) non && post;; | ||
o) off && post;; | ||
*) non && off && post;; | ||
esac | ||
exit 1 |