#!/system/bin/sh

STATUS=/data/local/tmp/magisk-env.result
STATUS_TMP=/data/local/tmp/magisk-env.result.tmp
LOG=/data/local/tmp/magisk-env.log

rm -f "$STATUS" "$STATUS_TMP" "$LOG"
sh /data/local/tmp/complete_magisk_env.sh >"$LOG" 2>&1
rc=$?
printf '%s\n' "$rc" >"$STATUS_TMP"
chmod 644 "$STATUS_TMP" "$LOG"
mv -f "$STATUS_TMP" "$STATUS"
exit "$rc"
