diff --git a/_bin/rtpctl.d b/_bin/rtpctl.d index 00f1e1b..cc0974d 100755 --- a/_bin/rtpctl.d +++ b/_bin/rtpctl.d @@ -280,6 +280,12 @@ manage-ipvlan() { # ip link show [ DEVICE | group GROUP ] [up] [master DEV] [vrf NAME] [type TYPE] [nomaster] } + +if [ "${1}" == '--debug' ]; then + shift + set -x +fi + case "${1}" in cli) runtipi-cli "${@:2}" @@ -342,6 +348,11 @@ case "${1}" in editme) ${VISUAL:-${EDITOR:-vi}} "$(readlink -f "$0")" ;; + git) + GIT_ARGS="$( printf '"%s" ' "${@:2}" )" + [ "$GIT_ARGS" != '"update"' ] || GIT_ARGS="pull --rebase --autostash" + exec sh -c 'cd user-config && git '"${GIT_ARGS}"'; exit $?' + ;; _load) echo "alias ${BASE_NAME}cd='cd \"$SCRIPT_DIR/..\"'" ;; @@ -354,31 +365,36 @@ case "${1}" in "Available commands:" "" ""\ "" "" "" \ "runtipi" "" ""\ - "" "cli" "runtipi-cli" \ - "" "log" "runtipi docker stack logs" \ - "" "start" "start runtipi" \ - "" "update" "update runtipi to a specific version" \ + "" "cli" "runtipi-cli" \ + "" "log" "runtipi docker stack logs" \ + "" "start" "start runtipi" \ + "" "update" "update runtipi to a specific version" \ "" "" "" \ "docker/docker-compose" "" ""\ - "" "tpcompose" "docker compose for runtipi apps" \ - "" "ixcompose" "docker compose for ix/TrueNAS SCALE docker based app" \ - "" "ls" "list applications (or contrainers)" \ - "" "dls" "stylized docker ls" \ - "" "shell" "enter an insteractive shell" \ - "" "down-all" "stop and remove everything" \ + "" "tpcompose" "docker compose for runtipi apps" \ + "" "ixcompose" "docker compose for ix/TrueNAS SCALE docker based app" \ + "" "ls" "list applications (or contrainers)" \ + "" "dls" "stylized docker ls" \ + "" "shell" "enter an insteractive shell" \ + "" "down-all" "stop and remove everything" \ "" "" "" \ "networking" "" ""\ - "" "ipvlan" "manage ipvlan networking interface fix" \ + "" "ipvlan" "manage ipvlan networking interface fix" \ "" "" "" \ "misc." "" ""\ - "" "exec" "execute within the shell, START_DIR env applies" \ + "" "exec" "execute within the shell, START_DIR env applies" \ "" "" "" \ - "" "setup" "setup runtipictl in user's .local/bin dir" \ + "" "setup" "setup runtipictl in user's .local/bin dir" \ "" "" "${BASE_NAME} setup" \ "" "" "${BASE_NAME} setup '' ~/.local/bin/${BASE_BASE_NAME}" \ + "" "" "${BASE_NAME} setup '' ~/.local/bin/tpc" \ "" "" "${BASE_NAME} setup '' ~/.local/bin/runtipictl" \ "" "" "" \ + "" "editme" "Open the script in the EDITOR" \ + "" "git [update]" "Perform git operations on user-config," \ + "" "" "update sub-command is a shortcut to pull --autostash --rebase" \ "Related env. vars:" "" "" \ + "" "" "" \ "" "VISUAL EDITOR RPH_UID QUIET START_DIR ROOT_EXEC" "" ;;