Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cls
- ::Variables (please modify only if you know what you're doing)
- set SSH_User=root
- set SSH_Password=jci
- set SSH_Command="echo 1 > /sys/class/gpio/Watchdog\ Disable/value"
- set PLINKPath="%~d0%~p0bin\PLINK.EXE"
- set PingPath="%~d0%~p0bin\Fping.exe"
- set CMU_IP=%1
- ::Ask for IP of CMU if this was not given via CMD argument
- if "%CMU_IP%" =="" (
- set /p CMU_IP="IP of CMU (e.g. 192.168.168.1): "
- )
- :PingCheckUp
- ::Check if CMU IP is reachable via FPING
- %PingPath% %CMU_IP% -i -w 1 -n 1 -l >NUL
- ::If reachable, goto RemoteSSH_Command, otherwise show info and check again immediately
- if "%errorlevel%"=="0" (
- goto RemoteSSH_Command
- ) ELSE (
- echo CMU is still offline...%time%
- echo.
- goto PingCheckUp
- )
- :RemoteSSH_Command
- ::Logon and execute SSH command on CMU
- %PLINKPath% -v %SSH_User%@%CMU_IP% -pw %SSH_Password% %SSH_Command%
- ::If execution was successfull, show info. Otherwise restart script.
- if "%errorlevel%"=="0" (
- echo.
- echo It seems like we were able to disable the Infotainment watchdog!
- pause
- ) ELSE (
- echo.
- echo Error...restarting script.
- echo.
- goto PingCheckUp
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement