android_device_oneplus_dre/rootdir/bin/init.oplus_chg.sh
Bruno Martins b2e66f9cc7 sm8350-common: Update init scripts from OOS 11.2.5.5
Change-Id: Ia4e798ae3c5cbdb7246669b833c75e7058efa523
2021-06-01 21:43:16 +01:00

29 lines
653 B
Bash
Executable file

#! /vendor/bin/sh
export PATH=/vendor/bin
prefix="/sys/class/oplus_chg"
call_on_name="call_on"
if [[ -d "$prefix" ]]
then
for i in `ls "$prefix"`
do
for j in `ls "$prefix"/"$i"`
do
#skip directories to prevent possible security issues.
if [[ -d "$prefix"/"$i"/"$j" ]]
then
continue
else
if [[ "$j" == "$call_on_name" ]]
then
chown -h radio.radio "$prefix"/"$i"/"$j"
else
chown -h system.system "$prefix"/"$i"/"$j"
fi
fi
done
done
fi