Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalibor91/basher
simple bash script to easy run and add new shell scripts
https://github.com/dalibor91/basher
bash basher management remote-execution scrips shell
Last synced: about 1 month ago
JSON representation
simple bash script to easy run and add new shell scripts
- Host: GitHub
- URL: https://github.com/dalibor91/basher
- Owner: dalibor91
- License: mit
- Created: 2017-06-30T14:50:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T15:20:55.000Z (11 months ago)
- Last Synced: 2024-02-17T15:54:40.229Z (11 months ago)
- Topics: bash, basher, management, remote-execution, scrips, shell
- Language: Shell
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# basher
simple bash program to easy run and add new bash scripts[![asciicast](https://asciinema.org/a/ZlmhsfVyJdbh37YBqrOP9VhmU.svg)](https://asciinema.org/a/ZlmhsfVyJdbh37YBqrOP9VhmU)
install
```
sudo mkdir /var/lib/bshr && \
sudo curl -o /var/lib/bshr/bshr https://raw.githubusercontent.com/dalibor91/basher/master/basher.sh && \
sudo chmod +x /var/lib/bshr/bshr && \
sudo ln -s /var/lib/bshr/bshr /usr/local/bin/bshr
```You can easy manage and download thousands of bash scripts and use them easily
Example of use
Download test shell script
```
root@vg# bshr -a 'https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh'
Description:
basher test script
--2017-06-30 17:38:12-- https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 98 [text/plain]
Saving to: `/root/.basher/scripts/2017_06_30_17_38_07.sh'100%[====================================================================================================================================================================================================================================================================================>] 98 --.-K/s in 0s
2017-06-30 17:38:12 (15.4 MB/s) - `/root/.basher/scripts/2017_06_30_17_38_07.sh' saved [98/98]
Enter command name to run like:
basher laskjd this is not valid
Enter command name to run like:
basher_test
```To see all installed scripts run:
```
root@vg# bshr --list
Alias: basher_test
```To see details of some specific script run
```
root@vg# basher --explain basher_test
Downlaoded from
https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh
--------------------------
basher test script
```To run script run
```
root@vg# bshr -r basher_test 123 456 6789 000
Argument 0 /root/.basher/scripts/2017_06_30_17_38_07.sh
Argument 1 123
Argument 2 456
Argument 3 6789
```To remove script run
```
root@vg# bshr -d basher_test
Removed!
```To see all options run
```
root@vg# bshr -h
BSHR is small script that enables you running and managing shell scripts with one command
bshr
-a | --add - add script to basher, local or remote
-e | --edit <alias> - edit script that you saved by some alias
-r | --run <alias> - run script that you saved by some alias
-d | --delete <alias> - deletes script
-H | --host <user@host> - destination where to run script
-e | --explain <alias> - print description message
-l | --list - list all scripts
-h | --help - this message
-su | --switch-user <user> - run as this user (requires su permissions)
-env - load env variables from files
--args - pass arguments to script
--update - update basher
--cleanup - clear allScript can be added from remote url or locally. If alias and description not provided with env variables,
program expect them from stdin.Example:
ADD_ALIAS=test ADD_DESCRIPTION=\"some test description\" bshr -a /tmp/test.sh
bshr -a /tmp/test.sh
bshr -e test # edits test script
DEFAULT_EDITOR=vim bshr -e test
bshr -r test
bshr -r test -H [email protected]
bshr -r test --args 'pass to script' 'also this'
bsht -r test -H [email protected] --args 'additional' 'arg'
```