-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathtlp-rdw.in
56 lines (45 loc) · 1.04 KB
/
tlp-rdw.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# tlp-rdw - enable/disable RDW
#
# Copyright (c) 2025 Thomas Koch <linrunner at gmx.net> and others.
# SPDX-License-Identifier: GPL-2.0-or-later
# --- Source libraries
for lib in @TLP_TLIB@/tlp-func-base @TLP_FLIB@/25-tlp-func-rf @TLP_FLIB@/30-tlp-func-rf-sw; do
# shellcheck disable=SC1090
. "$lib" || exit 70
done
# --- MAIN
# shellcheck disable=SC2034
_bgtask=1
carg1="$1"
if [ "$carg1" = "--version" ]; then
print_version
exit 0
fi
# read configuration: quit on error, trace allowed
read_config 1 0
parse_args4config "$@"
cprintf_init
case $carg1 in
"")
if check_run_flag "$RDW_KILL"; then
echo "tlp-rdw: disabled."
else
echo "tlp-rdw: enabled."
fi
;;
enable)
check_root
reset_run_flag "$RDW_KILL"
echo "tlp-rdw: enabled."
;;
disable)
check_root
set_run_flag "$RDW_KILL"
echo "tlp-rdw: disabled."
;;
*)
echo "Usage: tlp-rdw [ enable | disable ]"
do_exit 3
esac
do_exit 0