aboutsummaryrefslogtreecommitdiff
path: root/etc/hyperthreading.sh
diff options
context:
space:
mode:
Diffstat (limited to 'etc/hyperthreading.sh')
-rwxr-xr-xetc/hyperthreading.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/hyperthreading.sh b/etc/hyperthreading.sh
index 977942965..e003d8fb5 100755
--- a/etc/hyperthreading.sh
+++ b/etc/hyperthreading.sh
@@ -1,6 +1,14 @@
#!/bin/sh
set -eu
+usage() {
+ echo "USAGE: $0 <on|off>" ; exit 111
+}
+
+if [ "$#" -eq 0 ]; then
+ usage
+fi
+
case $1 in
on)
for f in "/sys/devices/system/cpu/cpu"[0-9]*/online; do
@@ -20,5 +28,5 @@ case $1 in
cores=$(printf "$cores\n$coreid")
done
;;
- *) echo "USAGE: hyperthreading.sh <on|off>"
+ *) usage
esac