diff --git a/README.md b/README.md index b1b94bb..1c45f3a 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,10 @@ git clone https://winklerfamilie.eu/git/efelon/shell_sequencer.git /opt/sequence ln -s /opt/sequencer/sequencer/sequencer.sh /usr/local/bin ln -s /opt/sequencer/seqs /opt ``` +or + +use the simple bash installation script in the repository: + +``` +curl -L https://winklerfamilie.eu/git/efelon/shell_sequencer/raw/branch/master/install.sh | bash +``` diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..1034df7 --- /dev/null +++ b/install.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +SEQLOC="/opt" +SEQHOME="${SEQLOC}/sequencer" +SEQGITURL="https://winklerfamilie.eu/git/efelon/shell_sequencer.git" + +if [ -d "$SEQHOME" ]; then + echo " [E] Sequencer seems to be installed already at:" + echo " $SEQHOME" + exit 1 +fi +if [ ! -w "$SEQLOC" ]; then + echo " [E] Your user has no permission to write to $SEQLOC" + exit 2 +fi + +which git >>/dev/null 2>&1 +if [ $? != 0 ]; then + echo " [W] Git not found and will be installed" + apt update + if [ $? != 0 ]; then + echo " [W] Cannot update apt repositories" + fi + apt install git -y + if [ $? != 0 ]; then + echo " [E] Cannot install git via apt" + exit 4 + fi +fi + +git clone $SEQGITURL "$SEQHOME" +if [ $? != 0 ]; then + echo " [E] Error cloning git repository:" + echo " $SEQGITURL" + exit 6 +fi + +ln -s "${SEQHOME}/sequencer/sequencer.sh" "/usr/local/bin" +ln -s "${SEQHOME}/seqs" "/opt" + +echo " [I] Successfully installed shell sequencer" +echo " Don't forget to set git user variables:" +echo " git config user.name=\"Your Name\"" +echo " git config user.email=\"Your.Name@example.com\""