Files
shell_sequencer/README.md

63 lines
1.8 KiB
Markdown

# shell_sequencer
Shell script as wrapper for sequential tasks, such as complex server installations or recurring maintenance tasks.
The sequence script (**seq**) containing different steps is separated from the sequence control (**sequencer.sh**). The seq just needs to "include" the sequencer.sh at the end.
## sequencer.sh
Main sequencer script to be included at the end of a seq.
## seqs/
Contains sequences (seqs) for different tools, servers or occasions.
Sequencer include working on sh and bash.
[...]
. /usr/local/bin/sequencer.sh
see seqTemplateExample.sh (which can be generated when calling sequencer.sh directly)
## Installation recommendation
To make all seqs avaialable to all user, follow the procedure below.
Run folloing commands as root:
```
git clone https://winklerfamilie.eu/git/efelon/shell_sequencer.git /opt/sequencer
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
```
## Bash-completion
The included optional bash-completion script `sqnall-completion.bash` provides aliases to all available sequences as well as completion for sequencer.sh options and steps (including aliases) individually for each sequence. The aliases have the prefix `sqn_` which stands for _sequence name_.
After executing
```
source /opt/sequencer/sqnall-completion.bash
```
e.g. `/opt/sequencer/seqs/kodi.sh` can be started anyhere with `sqn_kodi`
### Automatic setup after login
To automatically provide aliases and bash-completion after login, the following bash script needs to be executed once for each user separately:
```
source /opt/sequencer/installCompletion.sh
```
This sources the bash-completion script in the users .bashrc file.