karnel-termux 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +454 -0
- package/install.sh +272 -0
- package/karnel/bin/karnel +77 -0
- package/karnel/cli/commands/brain.sh +1553 -0
- package/karnel/cli/commands/cleanup.sh +66 -0
- package/karnel/cli/commands/doctor.sh +1528 -0
- package/karnel/cli/commands/env.sh +233 -0
- package/karnel/cli/commands/help.sh +8 -0
- package/karnel/cli/commands/ia.sh +502 -0
- package/karnel/cli/commands/init.sh +1274 -0
- package/karnel/cli/commands/install.sh +718 -0
- package/karnel/cli/commands/list.sh +399 -0
- package/karnel/cli/commands/open.sh +106 -0
- package/karnel/cli/commands/pg.sh +719 -0
- package/karnel/cli/commands/reinstall.sh +663 -0
- package/karnel/cli/commands/show.sh +90 -0
- package/karnel/cli/commands/start.sh +54 -0
- package/karnel/cli/commands/status.sh +96 -0
- package/karnel/cli/commands/uninstall.sh +668 -0
- package/karnel/cli/commands/update.sh +723 -0
- package/karnel/cli/commands/upgrade.sh +40 -0
- package/karnel/cli/commands/version.sh +3 -0
- package/karnel/cli/commands/voice.sh +230 -0
- package/karnel/cli/karnel.sh +706 -0
- package/karnel/modules/ai.sh +135 -0
- package/karnel/modules/auto.sh +114 -0
- package/karnel/modules/db.sh +132 -0
- package/karnel/modules/deploy.sh +74 -0
- package/karnel/modules/dev.sh +148 -0
- package/karnel/modules/editor.sh +115 -0
- package/karnel/modules/lang.sh +124 -0
- package/karnel/modules/npm.sh +146 -0
- package/karnel/modules/shell.sh +338 -0
- package/karnel/modules/ui.sh +139 -0
- package/karnel/modules/voice.sh +118 -0
- package/karnel/tools/ai/all.sh +209 -0
- package/karnel/tools/ai/antigravity-cli/README.md +45 -0
- package/karnel/tools/ai/antigravity-cli/bin/agy +28 -0
- package/karnel/tools/ai/antigravity-cli/helper/agy_helper.c +39 -0
- package/karnel/tools/ai/antigravity-cli/install.sh +469 -0
- package/karnel/tools/ai/claude-code/README.md +45 -0
- package/karnel/tools/ai/claude-code/bin/claude +29 -0
- package/karnel/tools/ai/claude-code/helper/claude_helper.c +42 -0
- package/karnel/tools/ai/claude-code/install.sh +278 -0
- package/karnel/tools/ai/cline/install.sh +160 -0
- package/karnel/tools/ai/codegraph/README.md +43 -0
- package/karnel/tools/ai/codegraph/bin/codegraph +5 -0
- package/karnel/tools/ai/codegraph/install.sh +160 -0
- package/karnel/tools/ai/codex/README.md +44 -0
- package/karnel/tools/ai/codex/install.sh +104 -0
- package/karnel/tools/ai/command-code/README.md +62 -0
- package/karnel/tools/ai/command-code/install.sh +136 -0
- package/karnel/tools/ai/crush/README.md +17 -0
- package/karnel/tools/ai/crush/install.sh +89 -0
- package/karnel/tools/ai/ctx7/README.md +26 -0
- package/karnel/tools/ai/ctx7/install.sh +61 -0
- package/karnel/tools/ai/engram/README.md +44 -0
- package/karnel/tools/ai/engram/install.sh +127 -0
- package/karnel/tools/ai/freebuff/README.md +52 -0
- package/karnel/tools/ai/freebuff/bin/freebuff +28 -0
- package/karnel/tools/ai/freebuff/helper/freebuff_helper.c +47 -0
- package/karnel/tools/ai/freebuff/install.sh +303 -0
- package/karnel/tools/ai/gemini-cli/README.md +46 -0
- package/karnel/tools/ai/gemini-cli/install.sh +111 -0
- package/karnel/tools/ai/gentle-ai/README.md +42 -0
- package/karnel/tools/ai/gentle-ai/install.sh +253 -0
- package/karnel/tools/ai/gentle-ai/termux-patches.go +256 -0
- package/karnel/tools/ai/gga/README.md +49 -0
- package/karnel/tools/ai/gga/install.sh +134 -0
- package/karnel/tools/ai/hermes-agent/README.md +50 -0
- package/karnel/tools/ai/hermes-agent/install.sh +120 -0
- package/karnel/tools/ai/kilocode-cli/README.md +45 -0
- package/karnel/tools/ai/kilocode-cli/bin/kilocode +21 -0
- package/karnel/tools/ai/kilocode-cli/helper/kilocode_helper.c +47 -0
- package/karnel/tools/ai/kilocode-cli/install.sh +179 -0
- package/karnel/tools/ai/kimchi-code/README.md +53 -0
- package/karnel/tools/ai/kimchi-code/install.sh +221 -0
- package/karnel/tools/ai/kimi-code/README.md +45 -0
- package/karnel/tools/ai/kimi-code/install.sh +111 -0
- package/karnel/tools/ai/kiro/README.md +17 -0
- package/karnel/tools/ai/kiro/install.sh +134 -0
- package/karnel/tools/ai/mimocode/README.md +43 -0
- package/karnel/tools/ai/mimocode/bin/mimo +28 -0
- package/karnel/tools/ai/mimocode/helper/mimocode_helper.c +47 -0
- package/karnel/tools/ai/mimocode/install.sh +287 -0
- package/karnel/tools/ai/minimax-cli/README.md +45 -0
- package/karnel/tools/ai/minimax-cli/install.sh +111 -0
- package/karnel/tools/ai/mistral-vibe/README.md +46 -0
- package/karnel/tools/ai/mistral-vibe/install.sh +119 -0
- package/karnel/tools/ai/odysseus/README.md +35 -0
- package/karnel/tools/ai/odysseus/install.sh +198 -0
- package/karnel/tools/ai/ollama/README.md +44 -0
- package/karnel/tools/ai/ollama/install.sh +78 -0
- package/karnel/tools/ai/omni-route/README.md +111 -0
- package/karnel/tools/ai/omni-route/install.sh +165 -0
- package/karnel/tools/ai/openclaude/README.md +46 -0
- package/karnel/tools/ai/openclaude/install.sh +110 -0
- package/karnel/tools/ai/openclaw/README.md +47 -0
- package/karnel/tools/ai/openclaw/install.sh +112 -0
- package/karnel/tools/ai/opencode/README.md +51 -0
- package/karnel/tools/ai/opencode/bin/opencode +28 -0
- package/karnel/tools/ai/opencode/helper/opencode_helper.c +57 -0
- package/karnel/tools/ai/opencode/install.sh +290 -0
- package/karnel/tools/ai/openspec/README.md +34 -0
- package/karnel/tools/ai/openspec/install.sh +61 -0
- package/karnel/tools/ai/pi/README.md +46 -0
- package/karnel/tools/ai/pi/install.sh +104 -0
- package/karnel/tools/ai/qwen-code/README.md +45 -0
- package/karnel/tools/ai/qwen-code/install.sh +111 -0
- package/karnel/tools/auto/all.sh +57 -0
- package/karnel/tools/auto/n8n/README.md +47 -0
- package/karnel/tools/auto/n8n/install.sh +102 -0
- package/karnel/tools/db/all.sh +61 -0
- package/karnel/tools/db/mariadb/README.md +43 -0
- package/karnel/tools/db/mariadb/install.sh +65 -0
- package/karnel/tools/db/mongodb/README.md +42 -0
- package/karnel/tools/db/mongodb/install.sh +73 -0
- package/karnel/tools/db/postgresql/README.md +45 -0
- package/karnel/tools/db/postgresql/install.sh +65 -0
- package/karnel/tools/db/redis/README.md +46 -0
- package/karnel/tools/db/redis/install.sh +64 -0
- package/karnel/tools/db/sqlite/README.md +44 -0
- package/karnel/tools/db/sqlite/install.sh +65 -0
- package/karnel/tools/deploy/all.sh +43 -0
- package/karnel/tools/deploy/netlify/install.sh +41 -0
- package/karnel/tools/deploy/railway/install.sh +109 -0
- package/karnel/tools/deploy/vercel/install.sh +43 -0
- package/karnel/tools/dev/all.sh +77 -0
- package/karnel/tools/dev/bat/README.md +44 -0
- package/karnel/tools/dev/bat/install.sh +82 -0
- package/karnel/tools/dev/bc/README.md +44 -0
- package/karnel/tools/dev/bc/install.sh +82 -0
- package/karnel/tools/dev/cloudflared/README.md +43 -0
- package/karnel/tools/dev/cloudflared/install.sh +82 -0
- package/karnel/tools/dev/curl/README.md +43 -0
- package/karnel/tools/dev/curl/install.sh +82 -0
- package/karnel/tools/dev/fzf/README.md +44 -0
- package/karnel/tools/dev/fzf/install.sh +82 -0
- package/karnel/tools/dev/gh/README.md +43 -0
- package/karnel/tools/dev/gh/install.sh +82 -0
- package/karnel/tools/dev/html2text/README.md +44 -0
- package/karnel/tools/dev/html2text/install.sh +82 -0
- package/karnel/tools/dev/imagemagick/README.md +44 -0
- package/karnel/tools/dev/imagemagick/install.sh +82 -0
- package/karnel/tools/dev/jq/README.md +44 -0
- package/karnel/tools/dev/jq/install.sh +82 -0
- package/karnel/tools/dev/lsd/README.md +44 -0
- package/karnel/tools/dev/lsd/install.sh +82 -0
- package/karnel/tools/dev/make/README.md +44 -0
- package/karnel/tools/dev/make/install.sh +82 -0
- package/karnel/tools/dev/ncurses/README.md +42 -0
- package/karnel/tools/dev/ncurses/install.sh +82 -0
- package/karnel/tools/dev/openssh/README.md +43 -0
- package/karnel/tools/dev/openssh/install.sh +75 -0
- package/karnel/tools/dev/proot/README.md +43 -0
- package/karnel/tools/dev/proot/install.sh +82 -0
- package/karnel/tools/dev/shfmt/README.md +44 -0
- package/karnel/tools/dev/shfmt/install.sh +82 -0
- package/karnel/tools/dev/tmate/README.md +44 -0
- package/karnel/tools/dev/tmate/install.sh +82 -0
- package/karnel/tools/dev/tmux/README.md +43 -0
- package/karnel/tools/dev/tmux/install.sh +75 -0
- package/karnel/tools/dev/translate/README.md +44 -0
- package/karnel/tools/dev/translate/install.sh +82 -0
- package/karnel/tools/dev/tree/README.md +44 -0
- package/karnel/tools/dev/tree/install.sh +82 -0
- package/karnel/tools/dev/udocker/README.md +44 -0
- package/karnel/tools/dev/udocker/install.sh +82 -0
- package/karnel/tools/dev/wget/README.md +44 -0
- package/karnel/tools/dev/wget/install.sh +82 -0
- package/karnel/tools/editor/all.sh +59 -0
- package/karnel/tools/editor/code-server/README.md +42 -0
- package/karnel/tools/editor/code-server/install.sh +74 -0
- package/karnel/tools/editor/neovim/README.md +43 -0
- package/karnel/tools/editor/neovim/install.sh +64 -0
- package/karnel/tools/editor/nvchad/README.md +45 -0
- package/karnel/tools/editor/nvchad/install.sh +105 -0
- package/karnel/tools/lang/all.sh +63 -0
- package/karnel/tools/lang/clang/README.md +43 -0
- package/karnel/tools/lang/clang/install.sh +79 -0
- package/karnel/tools/lang/golang/README.md +43 -0
- package/karnel/tools/lang/golang/install.sh +79 -0
- package/karnel/tools/lang/nodejs/README.md +43 -0
- package/karnel/tools/lang/nodejs/install.sh +79 -0
- package/karnel/tools/lang/perl/README.md +43 -0
- package/karnel/tools/lang/perl/install.sh +79 -0
- package/karnel/tools/lang/php/README.md +43 -0
- package/karnel/tools/lang/php/install.sh +79 -0
- package/karnel/tools/lang/python/README.md +43 -0
- package/karnel/tools/lang/python/install.sh +79 -0
- package/karnel/tools/lang/rust/README.md +43 -0
- package/karnel/tools/lang/rust/install.sh +79 -0
- package/karnel/tools/npm/all.sh +90 -0
- package/karnel/tools/npm/live-server/README.md +43 -0
- package/karnel/tools/npm/live-server/install.sh +96 -0
- package/karnel/tools/npm/localtunnel/README.md +43 -0
- package/karnel/tools/npm/localtunnel/install.sh +112 -0
- package/karnel/tools/npm/markserv/README.md +43 -0
- package/karnel/tools/npm/markserv/install.sh +95 -0
- package/karnel/tools/npm/ncu/README.md +43 -0
- package/karnel/tools/npm/ncu/install.sh +95 -0
- package/karnel/tools/npm/nestjs/README.md +43 -0
- package/karnel/tools/npm/nestjs/install.sh +95 -0
- package/karnel/tools/npm/ngrok/README.md +44 -0
- package/karnel/tools/npm/ngrok/install.sh +95 -0
- package/karnel/tools/npm/prettier/README.md +43 -0
- package/karnel/tools/npm/prettier/install.sh +95 -0
- package/karnel/tools/npm/psqlformat/README.md +43 -0
- package/karnel/tools/npm/psqlformat/install.sh +95 -0
- package/karnel/tools/npm/turbopack/README.md +8 -0
- package/karnel/tools/npm/turbopack/install.sh +42 -0
- package/karnel/tools/npm/typescript/README.md +43 -0
- package/karnel/tools/npm/typescript/install.sh +95 -0
- package/karnel/tools/npm/vercel/README.md +43 -0
- package/karnel/tools/npm/vercel/install.sh +95 -0
- package/karnel/tools/shell/all.sh +67 -0
- package/karnel/tools/shell/better-npm/README.md +43 -0
- package/karnel/tools/shell/better-npm/install.sh +85 -0
- package/karnel/tools/shell/fzf-tab/README.md +44 -0
- package/karnel/tools/shell/fzf-tab/install.sh +85 -0
- package/karnel/tools/shell/history-substring/README.md +43 -0
- package/karnel/tools/shell/history-substring/install.sh +85 -0
- package/karnel/tools/shell/powerlevel10k/README.md +43 -0
- package/karnel/tools/shell/powerlevel10k/install.sh +85 -0
- package/karnel/tools/shell/you-should-use/README.md +43 -0
- package/karnel/tools/shell/you-should-use/install.sh +85 -0
- package/karnel/tools/shell/zsh-autopair/README.md +44 -0
- package/karnel/tools/shell/zsh-autopair/install.sh +85 -0
- package/karnel/tools/shell/zsh-autosuggestions/README.md +43 -0
- package/karnel/tools/shell/zsh-autosuggestions/install.sh +85 -0
- package/karnel/tools/shell/zsh-completions/README.md +43 -0
- package/karnel/tools/shell/zsh-completions/install.sh +85 -0
- package/karnel/tools/shell/zsh-defer/README.md +43 -0
- package/karnel/tools/shell/zsh-defer/install.sh +85 -0
- package/karnel/tools/shell/zsh-syntax-highlighting/README.md +43 -0
- package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +72 -0
- package/karnel/tools/ui/all.sh +61 -0
- package/karnel/tools/ui/banner/README.md +42 -0
- package/karnel/tools/ui/banner/install.sh +160 -0
- package/karnel/tools/ui/cursor/README.md +42 -0
- package/karnel/tools/ui/cursor/install.sh +58 -0
- package/karnel/tools/ui/extra-keys/README.md +43 -0
- package/karnel/tools/ui/extra-keys/install.sh +62 -0
- package/karnel/tools/ui/font/README.md +43 -0
- package/karnel/tools/ui/font/install.sh +63 -0
- package/karnel/tools/voice/all.sh +27 -0
- package/karnel/tools/voice/install.sh +10 -0
- package/karnel/tools/voice/uninstall.sh +8 -0
- package/karnel/utils/banner.sh +492 -0
- package/karnel/utils/bootstrap.sh +25 -0
- package/karnel/utils/colors.sh +33 -0
- package/karnel/utils/dialogrc +30 -0
- package/karnel/utils/env.sh +53 -0
- package/karnel/utils/log.sh +567 -0
- package/karnel/utils/version.sh +205 -0
- package/package.json +42 -0
- package/scripts/npm-install.js +60 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
show_main() {
|
|
7
|
+
if [[ $# -eq 0 ]]; then
|
|
8
|
+
echo
|
|
9
|
+
box "Karnel Show"
|
|
10
|
+
echo
|
|
11
|
+
log_info "Usage: karnel show <module> --<tool>"
|
|
12
|
+
echo
|
|
13
|
+
log_info "Display help information for a specific tool."
|
|
14
|
+
echo
|
|
15
|
+
log_info "Available targets:"
|
|
16
|
+
echo
|
|
17
|
+
list_item "karnel show ai --opencode"
|
|
18
|
+
list_item "karnel show ai --ollama"
|
|
19
|
+
list_item "karnel show db --postgresql"
|
|
20
|
+
list_item "karnel show dev --gh"
|
|
21
|
+
list_item "karnel show npm --typescript"
|
|
22
|
+
list_item "karnel show all --<tool>"
|
|
23
|
+
echo
|
|
24
|
+
log_info "Run ${D_CYAN}karnel list <module>${NC} to see available tools"
|
|
25
|
+
echo
|
|
26
|
+
return
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
local module=""
|
|
30
|
+
local tool=""
|
|
31
|
+
|
|
32
|
+
for arg in "$@"; do
|
|
33
|
+
if [[ "$arg" == --* ]]; then
|
|
34
|
+
tool="${arg#--}"
|
|
35
|
+
elif [[ -z "$module" ]]; then
|
|
36
|
+
module="$arg"
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
if [[ -z "$module" ]]; then
|
|
41
|
+
log_error "Usage: karnel show <module> --<tool>"
|
|
42
|
+
return 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
if [[ -z "$tool" ]]; then
|
|
46
|
+
separator_section "$module - Available Tools"
|
|
47
|
+
echo
|
|
48
|
+
local tool_dir="$KARNEL_PATH/tools/$module"
|
|
49
|
+
if [[ ! -d "$tool_dir" ]]; then
|
|
50
|
+
log_error "Unknown module: $module"
|
|
51
|
+
return 1
|
|
52
|
+
fi
|
|
53
|
+
for t in "$tool_dir"/*/; do
|
|
54
|
+
local name="${t%/}"
|
|
55
|
+
name="${name##*/}"
|
|
56
|
+
if [[ -f "$tool_dir/$name/README.md" ]]; then
|
|
57
|
+
local first_line
|
|
58
|
+
first_line=$(head -1 "$tool_dir/$name/README.md" 2>/dev/null)
|
|
59
|
+
printf " ${D_CYAN}%-16s${NC} %s\n" "$name" "${first_line#\# }"
|
|
60
|
+
fi
|
|
61
|
+
done
|
|
62
|
+
echo
|
|
63
|
+
log_info "Run ${D_CYAN}karnel show $module --<tool>${NC} for details"
|
|
64
|
+
echo
|
|
65
|
+
return
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
local readme_path="$KARNEL_PATH/tools/$module/$tool/README.md"
|
|
69
|
+
|
|
70
|
+
if [[ ! -f "$readme_path" ]]; then
|
|
71
|
+
log_error "No documentation found for $module/$tool"
|
|
72
|
+
return 1
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
separator_section "$tool ($module)"
|
|
76
|
+
|
|
77
|
+
if command -v glow &>/dev/null; then
|
|
78
|
+
glow "$readme_path"
|
|
79
|
+
elif command -v pygmentize &>/dev/null; then
|
|
80
|
+
pygmentize -l markdown "$readme_path" 2>/dev/null | less -R
|
|
81
|
+
else
|
|
82
|
+
log_info "Showing documentation for $module/$tool:"
|
|
83
|
+
echo
|
|
84
|
+
cat "$readme_path"
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
echo
|
|
88
|
+
separator
|
|
89
|
+
echo
|
|
90
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
start_main() {
|
|
7
|
+
if [[ $# -eq 0 ]]; then
|
|
8
|
+
echo
|
|
9
|
+
box "Karnel Start"
|
|
10
|
+
echo
|
|
11
|
+
log_info "Usage: karnel start <target>"
|
|
12
|
+
echo
|
|
13
|
+
list_item "editor - Start code-server (VS Code in browser)"
|
|
14
|
+
echo
|
|
15
|
+
return
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
local target="$1"
|
|
19
|
+
shift
|
|
20
|
+
|
|
21
|
+
case "$target" in
|
|
22
|
+
editor)
|
|
23
|
+
_start_editor "$@"
|
|
24
|
+
;;
|
|
25
|
+
*)
|
|
26
|
+
log_warn "Unknown start target: $target"
|
|
27
|
+
log_info "Run 'karnel start' to see available targets"
|
|
28
|
+
;;
|
|
29
|
+
esac
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_start_editor() {
|
|
33
|
+
if ! command -v code-server &>/dev/null; then
|
|
34
|
+
log_warn "code-server is not installed"
|
|
35
|
+
log_info "Install with: ${D_CYAN}karnel install editor${NC}"
|
|
36
|
+
return 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
local port="${1:-8080}"
|
|
40
|
+
|
|
41
|
+
echo
|
|
42
|
+
box "Starting code-server"
|
|
43
|
+
echo
|
|
44
|
+
log_info "Starting VS Code in browser..."
|
|
45
|
+
log_info "Port: $port"
|
|
46
|
+
log_info "Password set via --auth password flag"
|
|
47
|
+
echo
|
|
48
|
+
log_success "Open http://localhost:$port in your browser"
|
|
49
|
+
echo
|
|
50
|
+
log_info "Press Ctrl+C to stop"
|
|
51
|
+
echo
|
|
52
|
+
|
|
53
|
+
code-server . --bind-addr "0.0.0.0:$port" --auth password
|
|
54
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
status_main() {
|
|
7
|
+
echo
|
|
8
|
+
box "Karnel Status"
|
|
9
|
+
echo
|
|
10
|
+
|
|
11
|
+
local -a services=()
|
|
12
|
+
|
|
13
|
+
# Disk
|
|
14
|
+
local disk
|
|
15
|
+
disk=$(df -h "$HOME" | awk 'NR==2 {print $4}')
|
|
16
|
+
log_success "Disk free: $disk"
|
|
17
|
+
|
|
18
|
+
# RAM
|
|
19
|
+
if [[ -f /proc/meminfo ]]; then
|
|
20
|
+
local total_kb free_kb
|
|
21
|
+
total_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
|
22
|
+
free_kb=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
|
|
23
|
+
log_success "RAM: $((total_kb/1024))MB total, $((free_kb/1024))MB free"
|
|
24
|
+
if (( free_kb < 200000 )); then
|
|
25
|
+
log_warn "Low memory"
|
|
26
|
+
fi
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Uptime
|
|
30
|
+
if [[ -f /proc/uptime ]]; then
|
|
31
|
+
local uptime_sec
|
|
32
|
+
uptime_sec=$(awk '{print int($1)}' /proc/uptime)
|
|
33
|
+
local days=$((uptime_sec / 86400))
|
|
34
|
+
local hours=$(( (uptime_sec % 86400) / 3600 ))
|
|
35
|
+
local mins=$(( (uptime_sec % 3600) / 60 ))
|
|
36
|
+
log_info "Uptime: ${days}d ${hours}h ${mins}m"
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# PostgreSQL
|
|
40
|
+
if command -v pg_ctl &>/dev/null; then
|
|
41
|
+
if pg_isready -q 2>/dev/null; then
|
|
42
|
+
log_success "PostgreSQL: RUNNING"
|
|
43
|
+
services+=("pg")
|
|
44
|
+
else
|
|
45
|
+
log_warn "PostgreSQL: STOPPED"
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# code-server
|
|
50
|
+
if command -v code-server &>/dev/null; then
|
|
51
|
+
if pgrep -f "code-server" &>/dev/null; then
|
|
52
|
+
log_success "code-server: RUNNING"
|
|
53
|
+
services+=("code-server")
|
|
54
|
+
else
|
|
55
|
+
log_info "code-server: not started"
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# omni-route web
|
|
60
|
+
if pgrep -f "omni-route-web" &>/dev/null; then
|
|
61
|
+
log_success "omni-route: RUNNING"
|
|
62
|
+
services+=("omni-route")
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Internet
|
|
66
|
+
if command -v ping &>/dev/null; then
|
|
67
|
+
if timeout 3 ping -c 1 -W 3 8.8.8.8 &>/dev/null; then
|
|
68
|
+
log_success "Internet: OK"
|
|
69
|
+
else
|
|
70
|
+
log_warn "Internet: unreachable"
|
|
71
|
+
fi
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# Karnel version
|
|
75
|
+
log_success "Karnel: v$KARNEL_VERSION"
|
|
76
|
+
|
|
77
|
+
# Last update check
|
|
78
|
+
local last_check="$KARNEL_CACHE/last_version_check"
|
|
79
|
+
if [[ -f "$last_check" ]]; then
|
|
80
|
+
local check_time
|
|
81
|
+
check_time=$(cat "$last_check" 2>/dev/null)
|
|
82
|
+
local now
|
|
83
|
+
now=$(date +%s)
|
|
84
|
+
local age=$(( (now - check_time) / 86400 ))
|
|
85
|
+
log_info "Last update check: ${age}d ago"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
echo
|
|
89
|
+
local count=${#services[@]}
|
|
90
|
+
if (( count > 0 )); then
|
|
91
|
+
log_success "${count} service(s) running: ${services[*]}"
|
|
92
|
+
else
|
|
93
|
+
log_info "No services running"
|
|
94
|
+
fi
|
|
95
|
+
echo
|
|
96
|
+
}
|