Skip to content

Commit dedec1a

Browse files
committed
module: add dynamic description
1 parent cb21c2e commit dedec1a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

module/service.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ KPNDIR="/data/adb/kp-next"
55
PATH="$MODDIR/bin:$PATH"
66
CONFIG="$KPNDIR/package_config"
77
key="$(cat $KPNDIR/key | base64 -d)"
8+
active="Status: active 😊"
9+
inactive="Status: inactive 😕"
10+
info="info: key incorrect, not set or kernel not patched yet ❌"
11+
string="description=$inactive | $info"
12+
13+
sed -i "s/^description=.*/$string/" "$MODDIR/module.prop"
814

915
if [ -z "$key" ] || [ -z "$(kpatch $key hello)" ]; then
1016
touch "$MODDIR/unresolved"
@@ -31,3 +37,10 @@ tail -n +2 "$CONFIG" | while IFS=, read -r pkg exclude allow uid; do
3137
[ -n "$UID" ] && kpatch "$key" exclude_set "$UID" 1
3238
fi
3339
done
40+
41+
if [ -n "$key" ] && kpatch "$key" hello >/dev/null 2>&1; then
42+
KPM_COUNT="$(kpatch "$key" kpm num 2>/dev/null || echo 0)"
43+
[ -z "$KPM_COUNT" ] && KPM_COUNT=0
44+
string="description=$active | kpmodule: $KPM_COUNT 💉"
45+
sed -i "s/^description=.*/$string/" "$MODDIR/module.prop"
46+
fi

0 commit comments

Comments
 (0)