anchor.diff:  set LOGFILE=tron.log
   
   :: Post-run delay (in seconds) before rebooting. Set to 0 to disable auto-reboot.
  -set REBOOT_DELAY=0
  +set AUTO_REBOOT_DELAY=0
   
   :: Set to anything but "no" in order to skip defrag regardless whether the system drive is an SSD or not.
   :: Leave as "no" to let the script auto-detect SSDs
  
positive.code: 
  :: Detect Solid State hard drives (determines if post-run defrag executes or not)
  :: This isn't pretty but has been the most reliable method so far
  pushd resources\stage_5_optimize\defrag
  set SSD_DETECTED=no
  smartctl -a /dev/sda | find /i "Solid State" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  smartctl -a /dev/sdb | find /i "Solid State" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  smartctl -a /dev/sdc | find /i "Solid State" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  smartctl -a /dev/sda | find /i "SSD" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  smartctl -a /dev/sdb | find /i "SSD" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  smartctl -a /dev/sdc | find /i "SSD" >NUL
  if "%ERRORLEVEL%"=="0" set SSD_DETECTED=yes
  popd
  
  
  :: Detect Solid State hard drives (determines if post-run defrag executes or not)
  :: Thanks to /u/Suddenly_Engineer and /u/Aberu for this solution
  :: Doesn't work reliably.
  REM pushd resources\stage_5_optimize\defrag
  REM set SSD_DETECTED=no
  REM for /f "tokens=1" %%i in ('smartctl --scan') do smartctl %%i -a | find /i "Solid State" >NUL
  REM if %ERRORLEVEL%==0 set SSD_DETECTED=yes
  REM for /f "tokens=1" %%i in ('smartctl --scan') do smartctl %%i -a | find /i "SSD" >NUL
  REM if %ERRORLEVEL%==0 set SSD_DETECTED=yes
  REM popd
  
  :: Detect Solid State hard drives (determines if post-run defrag executes or not)
  :: Alternate method by /u/Suddenly_Engineer. 
  :: Untested.
  REM pushd resources\stage_5_optimize\defrag
  REM setlocal enabledelayedexpansion
  REM for /f "tokens=1" %%i in ('smartctl --scan') do (
  	REM smartctl %%i -a | find /i "Solid State" >NUL
  	REM if "!ERRORLEVEL!"=="1" set SSD_DETECTED=no
  	REM )
  
  REM for /f "tokens=1" %%i in ('smartctl --scan') do (
  	REM smartctl %%i -a | find /i "SSD" >NUL
  	REM if "!ERRORLEVEL!"=="1" set SSD_DETECTED=no
  	REM )
  
  REM for /f "tokens=1" %%i in ('smartctl --scan') do (
  	REM smartctl %%i -a | find /i "RAID" >NUL
  	REM if "!ERRORLEVEL!"=="0" set SSD_DETECTED=yes
  REM )
  REM set local disabledelayedexpansion
  REM popd
  
  :: Detect Safe Mode
  set SAFE_MODE=no
  if /i "%SAFEBOOT_OPTION%"=="MINIMAL" set SAFE_MODE=yes
  if /i "%SAFEBOOT_OPTION%"=="NETWORK" set SAFE_MODE=yes
  
negative.code: echo ------------------------------------------------------------------------------->> %LOGPATH%\%LOGFILE%
  echo -------------------------------------------------------------------------------
  
  if not "%AUTO_REBOOT_DELAY%"=="0" shutdown /r /f /t %AUTO_REBOOT_DELAY% /c "Rebooting in %AUTO_REBOOT_DELAY% seconds to finish cleanup."
  pause
  