[Moto G4 Plus Questions & Answers] blitzik:
OK, I've run your script, but it looks like there were failures along the way (although it did start off working) and now my phone only boots to the unlocked bootloader can't be trusted screen and won't move from there. No boot loop, just stuck. I can still reset to fastboot mode, but not longer to TWRP recovery. I'm confident I was using the original rom, but honestly I can't tell. Big newb here, I didn't check what version of android I was running before tinkering. I only know that my version # is XT1625, and I downloaded the specific stock rom for that version.

Here's the readout from my terminal during my attempt.

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash logo logo.bin

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:logo: not found

target reported max download size of 536870912 bytes

sending 'logo' (1848 KB)...

OKAY [ 0.064s]

writing 'logo'...

OKAY [ 0.071s]

finished. total time: 0.138s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot boot.img

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:boot: not found

target reported max download size of 536870912 bytes

sending 'boot' (16384 KB)...

OKAY [ 0.526s]

writing 'boot'...

(bootloader) Image not signed or corrupt

OKAY [ 0.335s]

finished. total time: 0.864s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery recovery.img

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:recovery: not found

target reported max download size of 536870912 bytes

sending 'recovery' (16484 KB)...

OKAY [ 0.544s]

writing 'recovery'...

(bootloader) Image not signed or corrupt

OKAY [ 0.350s]

finished. total time: 0.898s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash dsp adspso.bin

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:dsp: not found

target reported max download size of 536870912 bytes

sending 'dsp' (16384 KB)...

OKAY [ 0.532s]

writing 'dsp'...

OKAY [ 0.326s]

finished. total time: 0.860s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash oem oem.img

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:oem: not found

target reported max download size of 536870912 bytes

sending 'oem' (96490 KB)...

OKAY [ 3.085s]

writing 'oem'...

OKAY [ 2.074s]

finished. total time: 5.161s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.0

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (261790 KB)...

OKAY [ 8.291s]

writing 'system'...

OKAY [ 5.640s]

finished. total time: 13.934s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.1

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (252965 KB)...

OKAY [ 8.092s]

writing 'system'...

OKAY [ 4.605s]

finished. total time: 12.699s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.2

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (255295 KB)...

OKAY [ 8.108s]

writing 'system'...

OKAY [ 6.222s]

finished. total time: 14.333s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.3

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (256631 KB)...

OKAY [ 8.136s]

writing 'system'...

OKAY [ 4.925s]

finished. total time: 13.064s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.4

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (256412 KB)...

OKAY [ 8.271s]

writing 'system'...

OKAY [ 4.602s]

finished. total time: 12.876s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.5

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (256741 KB)...

OKAY [ 8.222s]

writing 'system'...

OKAY [ 5.054s]

finished. total time: 13.278s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.6

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:system: not found

target reported max download size of 536870912 bytes

sending 'system' (256027 KB)...

OKAY [ 8.161s]

writing 'system'...

FAILED (status read failed (Too many links))

finished. total time: 9.311s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.7

< waiting for any device >

target didn't report max-download-size

sending 'system' (223276 KB)...

FAILED (command write failed (No error))

finished. total time: 0.007s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash modem NON-HLOS.bin

target didn't report max-download-size

sending 'modem' (76861 KB)...

FAILED (command write failed (No error))

finished. total time: 0.010s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst1

erasing 'modemst1'...

FAILED (command write failed (No error))

finished. total time: 0.005s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst2

erasing 'modemst2'...

FAILED (command write failed (No error))

finished. total time: 0.008s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash fsg fsg.mbn

target didn't report max-download-size

sending 'fsg' (1904 KB)...

FAILED (command write failed (No error))

finished. total time: 0.008s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase cache

erasing 'cache'...

FAILED (command write failed (No error))

finished. total time: 0.054s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

rebooting...