diff options
author | Debian Live user <user@debian-BULLSEYE-live-builder-AMD64> | 2023-04-27 23:03:13 -0400 |
---|---|---|
committer | Debian Live user <user@debian-BULLSEYE-live-builder-AMD64> | 2023-04-27 23:20:56 -0400 |
commit | 0ddc8c4eb89404383faad62c6dd56467bb144667 (patch) | |
tree | 031ba89f5bb40c2df22bb140ac05305305da96c0 /src | |
parent | 07d4f9c7df8d226ce77b9cf8e81432530f8a1cb4 (diff) |
remove dependency on bc
Diffstat (limited to 'src')
-rwxr-xr-x | src/sliceweasel.lib.sh | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/sliceweasel.lib.sh b/src/sliceweasel.lib.sh index 549e1e8..3b42a61 100755 --- a/src/sliceweasel.lib.sh +++ b/src/sliceweasel.lib.sh | |||
@@ -27,38 +27,6 @@ get_total_memory() | |||
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | math() | ||
31 | { | ||
32 | printf '%s\n' "$*" | bc -lq | ||
33 | } | ||
34 | |||
35 | get_total_io() | ||
36 | { | ||
37 | results=$IO_ROOT_DIR/io.test.result | ||
38 | zeroes=$IO_ROOT_DIR/io.test | ||
39 | if [ -e "$results" ] | ||
40 | then | ||
41 | age=$(get_age "$results") || return | ||
42 | if [ "$age" -gt $((60 * 60 * 24 * 7)) ] | ||
43 | then | ||
44 | rm "$results" | ||
45 | fi | ||
46 | fi | ||
47 | |||
48 | if ! [ -e "$results" ] | ||
49 | then | ||
50 | MEGS=128 | ||
51 | then=$(date +%s.%N) || return | ||
52 | dd if=/dev/zero of="$zeroes" bs=${MEGS}M count=1 || return | ||
53 | now=$(date +%s.%N) || return | ||
54 | rm "$zeroes" | ||
55 | speed=$(math $now - $then / $((MEGS * 1024 * 1024))) || return | ||
56 | echo $speed > "$results" | ||
57 | fi | ||
58 | read total < "$results" || return | ||
59 | echo ${total%.*} | ||
60 | } | ||
61 | |||
62 | root_write() | 30 | root_write() |
63 | { | 31 | { |
64 | $AS_ROOT sh -c 'cat > "$1"' sh "$1" || true | 32 | $AS_ROOT sh -c 'cat > "$1"' sh "$1" || true |