forked from FacuM/shellscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsweep2config.sh
More file actions
38 lines (38 loc) · 868 Bytes
/
sweep2config.sh
File metadata and controls
38 lines (38 loc) · 868 Bytes
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
#!/system/xbin/bash
# ====================
# Sweep2Config:
# easy S2S setup script for SomeFeaK.
# ====================
# Facundo Montero (facumo.fm@gmail.com)
# ====================
# Jun 12, 2017
# ====================
#
# Variable definition
NUM=1
# (1, default, from left to right)
# Function definition
function writenum {
if [ $NUM -gt -1 ] && [ $NUM -lt 4 ]
then
su -c "echo $NUM > /sys/sweep2sleep/sweep2sleep"
if [ $? -eq 0 ]
then
printf "\nSuccessful write for value $NUM to sweep2sleep driver.\n"
exit 0
fi
else
printf "\nFor value $NUM: out of bounds, value must be between 0 and 3.\n"
exit 1
fi
}
if [ -z "$1" ]
then
printf '\nPick a number: \n\n1 (default): from left to right.\n2: from right to left.\n3: both (RTL and LTR).\n0: none (disable).\n'
read NUM
writenum
else
printf '\nUsing non-interactive mode...\n'
NUM=$1
writenum
fi