reformat, add router shell intercept, and other tooling
This commit is contained in:
parent
244a7d471d
commit
6591b66247
6 changed files with 57 additions and 1 deletions
17
deploy-tools.sh
Normal file
17
deploy-tools.sh
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ! "$UID" = "0" ]; then
|
||||||
|
echo "# script must be ran as root"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
router)
|
||||||
|
cp tools/router.sh /usr/local/bin/router.sh
|
||||||
|
;;
|
||||||
|
repo)
|
||||||
|
mkdir /docker
|
||||||
|
cp * .* /docker
|
||||||
|
;;
|
||||||
|
esac
|
2
man
2
man
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
python3 utils/manager/main.py $@
|
python3 tools/manager/main.py $@
|
3
tools/.neorc
Normal file
3
tools/.neorc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# example neorc file
|
||||||
|
PREF_SHELL=zsh
|
||||||
|
USE_DOCK_MAN=yes
|
36
tools/router.sh
Executable file
36
tools/router.sh
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -f ~/.neorc ] && . ~/.neorc
|
||||||
|
|
||||||
|
ync() {
|
||||||
|
case $1 in
|
||||||
|
yes|y|YES|Y|1)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
no|n|NO|N|0|*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
dock() {
|
||||||
|
if ync $USE_DOCK_MAN; then
|
||||||
|
pushd /docker
|
||||||
|
./man $@
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
docker $@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
logs|l)
|
||||||
|
dock logs $2
|
||||||
|
;;
|
||||||
|
attach|a)
|
||||||
|
docker attach --sig-proxy=false $2
|
||||||
|
;;
|
||||||
|
shell|''|*)
|
||||||
|
${PREF_SHELL:-bash} $@
|
||||||
|
;;
|
||||||
|
esac
|
Reference in a new issue