Skip to content

Instantly share code, notes, and snippets.

@BRAVO68WEB
Created November 27, 2019 03:43
Show Gist options
  • Save BRAVO68WEB/3487b43662793f8d20890d9f36fc9a78 to your computer and use it in GitHub Desktop.
Save BRAVO68WEB/3487b43662793f8d20890d9f36fc9a78 to your computer and use it in GitHub Desktop.
Simple converter from batch (.bat) files to shell script (.sh)
#!/usr/bin/env bash
#
# Converts Windows batch script to Linux shell script
#
# Invocation:
# ./bat2sh script.bat
#
OUTFILE=${2:-${1%%.bat}.sh}
cat "$1" | \
sed \
-e 's/\bset\b/export/g' \
-e 's/%\([^/]\+\)%/${\1}/g' \
-e 's/^call.*$//g' \
-e 's/\r//' \
> "$OUTFILE"
chmod a+x "$OUTFILE"
@bari232311168
Copy link

@echo off
title Mauronofrio Fastboot Rom Flasher :P
:choice
set /P c=Do you want to wipe all the data ( Reccomended )[Y/N]?
if /I "%c%" EQU "Y" goto :wipe
if /I "%c%" EQU "N" goto :continue
goto :choice
:wipe
fastboot -w
goto :continue
:continue
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash cmnlib cmnlib.img
fastboot flash cmnlib64 cmnlib64.img
fastboot flash devcfg devcfg.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash hyp hyp.img
fastboot flash imagefv imagefv.img
fastboot flash keymaster keymaster.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot flash tz tz.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot
pause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment