heptocat / fortune

collection of fortune cookies to any imaginable topic
2 stars 6 forks source link

setup_custom script not working on ubuntu #22

Open umbeebmu opened 5 years ago

umbeebmu commented 5 years ago

$ uname -a Linux Celsius 5.3.0-19-generic #20-Ubuntu SMP Fri Oct 18 09:04:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ ./setup_custom_fortunes.sh /usr/games/fortune Fortune is not installed. Please install fortune. $ which fortune /usr/games/fortune $if command -v fortune; then echo true; else echo false; fi /usr/games/fortune true $ fortune Give your very best today. Heaven knows it's little enough.

umbeebmu commented 5 years ago

maybe I undertand what is the issue admin rights are needed to access /usr/local/share, but running the script as: sudo ./setup_custom_fortunes.sh then the test in the script to check if fortune is already installed did not work, so the condition had been reverted.

laurendc commented 5 years ago

@umbeebmu I've merged a fix that should resolve this concern. Can you please pull from master again and confirm? See #20

umbeebmu commented 5 years ago

Hi @laurendc thanks for the fix, it improves the situation but it does not fix it completely. in my environment a regular user cannot write into /usr/local/share, and running the script as an admin (using sudo) fails because by default the admin account does not have /usr/games in the $PATH. We could remove the check for the presence of fortune from the script, or I'm still looking for a way to have the check for the presence of 'fortune' working also for root. one option would be to hardcode the path to /usr/games/fortune for linux systems, but let's see if I can find a better way

laurendc commented 5 years ago

Just updating here - currently looking into updating how we are checking for the installation of fortune. It would be best to leave the check in there. So the options are to: