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

install script for easy system-wide installation #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
34 changes: 34 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#------------------------------------------------
# Installation script for botany
# Please run as superuser
#------------------------------------------------

PREFIX="/usr"

error_exit() {
echo -e "Botany Install: ${1:-"Unknown Error"}" >&2
exit 1
}

[[ $(id -u) != 0 ]] && error_exit "You must be root to run this script."

cp -r $PWD $PREFIX/share/
chmod 755 $PREFIX/share/botany
rm -f $PREFIX/share/botany/install.sh
chmod 755 $PREFIX/share/botany/art
chmod 644 $PREFIX/share/botany/art/*
chmod 644 $PREFIX/share/botany/*.py
chmod 755 $PREFIX/share/botany/botany.py
chmod 666 $PREFIX/share/botany/testsql.py

ln -s $PREFIX/share/botany/botany.py $PREFIX/bin/botany

$PREFIX/bin/botany &
sleep 3
pkill botany

chmod 755 $PREFIX/share/botany/sqlite
chmod 666 $PREFIX/share/botany/sqlite/garden_db.sqlite

echo "Botany has been installed! Simply run 'botany' to get started!"