Skip to content

Commit b2d9792

Browse files
implement in-place update
1 parent d840fa9 commit b2d9792

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.shellcheckrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ disable=SC2004
2020

2121
# redundant sed invocation
2222
disable=SC2001
23+
24+
# referencing unassigned variable
25+
# we need to reference magisk pre-set variables a lot
26+
disable=SC2154

magiskmodule/customize.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/system/bin/sh
2+
3+
exec 2>&1
4+
5+
[ "$BOOTMODE" != "true" ] && abort "Please install this module within the Magisk app."
6+
7+
# path to already installed module
8+
INSTALLEDMODPATH=/data/adb/modules/MagicalProtection
9+
10+
[ ! -d "$INSTALLEDMODPATH" ] && return 0
11+
[ ! -w /system/etc/hosts ] && return 0
12+
13+
ui_print "- Performing in-place update"
14+
15+
cp -v -r -f "$MODPATH"/* "$INSTALLEDMODPATH"
16+
cp -v -f "$MODPATH"/system/etc/hosts /system/etc/hosts
17+
18+
rm -v -r "$MODPATH"
19+
20+
exit 0

0 commit comments

Comments
 (0)