BatteryService: implement test version of charge treshold script

This commit is contained in:
Damian D'Souza
2025-10-09 17:44:25 +02:00
parent ca007ddbd8
commit 9e5f8a425e
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env -S bash
# Check if exectly one argument was provided
if [ "$#" -ne 1 ]; then
echo "Error: Battery level not specified" >&2
echo "Usage: $0 <number>" >&2
exit 1
fi
# Check if argument is a number
if ! [[ "$1" =~ ^[0-9]+$ ]]; then
echo "Error: Battery level must be a number" >&2
echo "Usage: $0 <number>" >&2
exit 1
fi
echo "$1" | pkexec tee ~/test