runtipictl improvements

+ START_DIR env
+ Usage output
+ dockge command
This commit is contained in:
Lockszmith (@kateryna) 2024-12-03 23:45:04 -05:00
parent b415cbd613
commit 1c7f324312
1 changed files with 22 additions and 13 deletions

View File

@ -7,7 +7,7 @@ jlmkr () {
JAIL_UID=${JAIL_UID:-${UID}}
jlmkr-exec () {
local cli='cd /srv/runtipi; '"${1:?Must supply command} "${2:+"$(
local cli="cd ${START_DIR:-/srv/runtipi}; ${1:?Must supply command} "${2:+"$(
printf '\"%s\" ' "${@:2}"
)"}
@ -68,21 +68,30 @@ case "${1}" in
dcoapp)
runtipi-app-docker-compose "${@:2}"
;;
dockge)
START_DIR=/srv/dockge/stacks/${2:?Must supply stack name} jlmkr-exec docker compose "${@:3}"
;;
setup)
ln -s "${BASH_SOURCE[0]}" "$HOME/.local/bin/"
ln -s $2 "$(cd "$(dirname "$0")" && pwd)/$(basename "$0")" "$HOME/.local/bin/"
;;
*)
printf '%s\n' \
"Usage:" \
"" \
"cli" \
"log" \
"start" \
"full-start" \
"exec" \
"docker" \
"dcoapp" \
"setup"
printf '%s %-12s %s\n' \
"" "" ""\
"Usage:" "" ""\
" $(basename "$0") <command> [args...]" "" ""\
"" "" "" \
"Available commands:" "" ""\
"" "" "" \
"" "cli" "runtipi-cli" \
"" "dcoapp" "docker compose for runtipi apps" \
"" "docker" "docker" \
"" "dockge" "dokcer compose for dockge stacks" \
"" "exec" "execute within the shell, START_DIR env applies" \
"" "full-start" "start runtipi jail, following with starting runtipi" \
"" "log" "runtipi docker stack logs" \
"" "start" "start runtipi" \
"" "" "" \
"" "setup" "setup runtipictl in user's .local/bin dir"
;;
esac