Skip to content

Commit

Permalink
Merge pull request #23 from Phate6660/patch-1
Browse files Browse the repository at this point in the history
Update install.sh
  • Loading branch information
ncdulo authored Jan 25, 2020
2 parents 9fc824b + 9485d2b commit 2f006dc
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions install.sh
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

0 comments on commit 2f006dc

Please sign in to comment.