-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "[+] Installing tacos in ${HOME}/.local/bin" | ||
mkdir -p $HOME/.local/bin/ | ||
git clone https://github.com/ariary/tacos.git && cd tacos | ||
go mod tidy | ||
make before.build | ||
make build.tacos && mv tacos $HOME/.local/bin/ | ||
|
||
echo "[+] Installing listener scripts in ${HOME}/.tacos" | ||
mkdir -p $HOME/.tacos | ||
mv light-pty4all $HOME/.tacos/ | ||
cd .. && rm -rf tacos | ||
|
||
echo "[+] Installing gitar in ${HOME}/.local/bin" | ||
go install github.com/ariary/gitar@latest | ||
|
||
echo "[+] Installing tmux" | ||
sudo apt install tmux | ||
|
||
echo "[+] Installing socat" | ||
sudo apt-get update && sudo apt-get install socat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Use this script to ease tacos/socat listener deployment | ||
for i in "$@"; do | ||
case $i in | ||
--ngrok|-n) | ||
NGROK=true | ||
shift;shift; | ||
;; | ||
--bore|-b) | ||
BORE=true | ||
shift;shift; | ||
;; | ||
--help|-h) | ||
HELP=true | ||
;; | ||
*) | ||
;; | ||
esac | ||
done | ||
|
||
|
||
## Help part | ||
if [[ "$HELP" ]]; | ||
then | ||
echo "Usage w/ tunneling: $0 [flag]"; | ||
echo -e "\t--bore to perform tunneling using bore" | ||
echo -e "\t--ngrok to perform tunneling using ngrok" | ||
echo | ||
echo "Usage w/o tunneling: $0 [lhost] [lport]"; | ||
exit 92 | ||
fi | ||
|
||
|
||
|
||
#### Cleaning part | ||
# this function is called when Ctrl-C is sent | ||
function trap_ctrlc () | ||
{ | ||
# perform cleanup here | ||
echo "\n[+] perform clean up before exit" | ||
rm server.* 2>/dev/null | ||
rm sh 2>/dev/null | ||
rm tacos 2>/dev/null | ||
rm socat-* 2>/dev/null | ||
rm $0 | ||
exit 92 | ||
} | ||
|
||
# initialise trap to call trap_ctrlc function when signal 2 (SIGINT) is received | ||
trap "trap_ctrlc" 2 | ||
|
||
#### Set environment | ||
if [[ "$NGROK" ]] || [[ -z "$BORE" ]]; | ||
then | ||
cp $HOME/.tacos/light-pty4all/socat-listener-behind-tunneling.sh . | ||
|
||
else | ||
cp $HOME/.tacos/light-pty4all/socat-listener.sh . | ||
fi | ||
cp $HOME/.tacos/light-pty4all/*.tpl . | ||
cp $HOME/.local/bin/tacos . | ||
|
||
if [[ "$NGROK" ]]; | ||
then | ||
./socat-listener-behind-tunneling.sh | ||
elif [[ "$BORE" ]]; | ||
then | ||
./socat-listener-behind-tunneling.sh --bore | ||
else | ||
./socat-listener.sh --lhost $1 --lport $2 --gitar | ||
fi |