mirror of
https://git.freebsd.org/ports.git
synced 2025-06-19 03:30:32 -04:00
"napi.sh" is a napiprojekt.pl client written in Bash. The purpose of the project was to create simple tool for systems with very limited resources (NAS QNAP drives, Synology, OpenWRT routers, Popcorn streamers, etc). It was inspired by "pynapi.py" script. "napi.sh" is distributed together with automatic subtitle format converter "subotage.sh" created specially for "napi.sh". "subotage.sh" is written in Bash and uses awk for text processing. PR: 245996
24 lines
638 B
Bash
24 lines
638 B
Bash
--- libs/libnapi_wrappers.sh.orig 2020-04-24 07:38:48 UTC
|
|
+++ libs/libnapi_wrappers.sh
|
|
@@ -129,13 +129,20 @@ wrappers_isSystemDarwin() {
|
|
}
|
|
|
|
#
|
|
+# @brief returns true if system is FreeBSD
|
|
+#
|
|
+wrappers_isSystemFreeBSD() {
|
|
+ [ "$(wrappers_getSystem_SO)" = "freebsd" ]
|
|
+}
|
|
+
|
|
+#
|
|
# @brief determines number of available cpu's in the system
|
|
#
|
|
# @param system type (linux|darwin)
|
|
#
|
|
wrappers_getCores_SO() {
|
|
local os="${1:-linux}"
|
|
- if wrappers_isSystemDarwin; then
|
|
+ if wrappers_isSystemDarwin || wrappers_isSystemFreeBSD; then
|
|
sysctl hw.ncpu | cut -d ' ' -f 2
|
|
else
|
|
grep -i processor /proc/cpuinfo | wc -l
|