forked from linrunner/TLP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtlp-rdw.in
49 lines (38 loc) · 935 Bytes
/
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
#!/bin/sh
# tlp-rdw - enable/disable RDW
#
# Copyright (c) 2021 Thomas Koch <linrunner at gmx.net> and others.
# This software is licensed under the GPL v2 or later.
# shellcheck disable=SC2086
# --- 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
# read configuration: quit on error, trace allowed
read_config 1 0
carg1=$1
parse_args4config "$@"
case $carg1 in
enable)
check_root
reset_run_flag $RDW_KILL
echo "tlp-rdw: enabled."
;;
disable)
check_root
set_run_flag $RDW_KILL
echo "tlp-rdw: disabled."
;;
*)
if check_run_flag $RDW_KILL; then
echo "tlp-rdw: disabled."
else
echo "tlp-rdw: enabled."
fi
;;
esac
do_exit 0