Simple installation script

This commit is contained in:
2020-09-05 14:34:15 +00:00
parent c0cfddb54a
commit 2cd478aae3
2 changed files with 51 additions and 0 deletions

View File

@@ -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
```

44
install.sh Executable file
View File

@@ -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\""