-
Notifications
You must be signed in to change notification settings - Fork 9
/
service.sh
25 lines (21 loc) · 919 Bytes
/
service.sh
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
#!/system/bin/sh
# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/...
# This will make your scripts compatible even if Magisk change its mount point in the future
MODDIR=${0%/*}
SCRIPT_DIR="$MODDIR/script"
if [ "$(cat $SCRIPT_DIR/pathinfo.sh | grep "$PATH")" == "" ]; then
echo "" >> $SCRIPT_DIR/pathinfo.sh
echo "# prefer to use busybox provided by magisk" >> $SCRIPT_DIR/pathinfo.sh
echo "PATH=$PATH" >> $SCRIPT_DIR/pathinfo.sh
fi
# support vtools
cp -af $SCRIPT_DIR/vtools-powercfg.sh /data/powercfg.sh
cp -af $SCRIPT_DIR/vtools-powercfg.sh /data/powercfg-base.sh
chmod 755 /data/powercfg.sh
chmod 755 /data/powercfg-base.sh
# powercfg path provided by magisk module
echo "sh $SCRIPT_DIR/powercfg_main.sh \"\$1\"" >> /data/powercfg.sh
# not relying on executable permissions
sh $SCRIPT_DIR/powercfg_main.sh
sh $SCRIPT_DIR/powercfg_once.sh
sh $SCRIPT_DIR/settings_override.sh