Install#
Dependencies#
Restsh works only inside the Bash shell and requires standard GNU core utilities like awk, sed, grep, etc.
Further dependencies are:
curl >= v7.76.0
jq >= 1.7
openssl
whiptail (newt)
Prepare your environment#
Restsh runs in any current Linux environment, WSL2, Docker and also on macOS. The Bash shell is required.
Windows: Install WSL2#
Install Windows Subsystem for Linux (Windows Feature)
Start an administrative Power Shell
wsl --install -d Debian
Warning
Restsh is not compatible with GitBash.
Linux#
Most packages should be already installed on a standard Linux installation.
awk
bash
coreutils
curl
gettext-base
git
grep
jq
newt (whiptail)
sed
yq
Warning
Restsh is not compatible with the BusyBox utilities, which are used by Alpine Linux, for example.
apt-get install curl gettext-base git jq openssl pandoc whiptail yq
macOS#
The required packages must be installed using Homebrew.
brew install bash curl yq jq coreutils findutils gnu-sed gawk grep newt
Then adjust the PATH accordingly:
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/curl/bin:$PATH"
PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/gawk/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/curl/bin:$PATH"
PATH="/opt/homebrew/bin:$PATH"
Clone the repository#
Personally, I manage all my Git repositories in a git folder in my home directory.
mkdir ~/git
cd ~/git
With HTTPS
git clone https://github.com/AxiansITSecurity/Restsh.git restsh
With SSH
git@github.com:AxiansITSecurity/Restsh.git restsh
Setup#
Change your working directory into the cloned folder and run the setup script.
cd restsh
restsh/restsh.setup init
This adjusts your .bashrc, sets an alias for restsh and creates the .restsh-config folder in your home directory.
Your .bashrc should now have entries like:
export RESTSH_CONFIG_PATH=/home/juergen/.restsh-config
alias restsh="/home/juergen/git/Restsh/restsh/restsh.start"
alias restsh.setup="/home/juergen/git/Restsh/restsh/restsh.setup"
Re-open the terminal or run . ~/.bashrc.
The RESTSH_CONFIG_PATH environment variable defines the folder for configuration files. Subfolders are supported.