.
This commit is contained in:
43
fix_syncthing.bat
Normal file
43
fix_syncthing.bat
Normal file
@ -0,0 +1,43 @@
|
||||
@REM @echo off
|
||||
call C:\Scripts\wLocal\localENV.bat
|
||||
@REM xxxxxxx
|
||||
echo "START: %~n0"
|
||||
|
||||
set BINARY=%homedrive%%homepath%\syncthing\syncthing
|
||||
|
||||
set MASTER_LIST=C:\Scripts\Secrets\master.list
|
||||
set SHARE_LIST=%homedrive%%homepath%\share.list
|
||||
set TEMP_LIST=%homedrive%%homepath%\temp.list
|
||||
set LOGNAME=%USERNAME%
|
||||
set MYHOST=%COMPUTERNAME%
|
||||
|
||||
%BINARY% --device-id > %TEMP_LIST%
|
||||
set /p MYID= < %TEMP_LIST%
|
||||
|
||||
echo "myID is %MYID%"
|
||||
|
||||
%BINARY% cli config devices %MYID% name set %MYHOST%.%LOGNAME%
|
||||
|
||||
%BINARY% cli config defaults folder fswatcher-enabled set true
|
||||
%BINARY% cli config defaults folder rescan-intervals set 19997
|
||||
%BINARY% cli config options min-home-disk-free unit set GB
|
||||
|
||||
%BINARY% cli config folders list > %TEMP_LIST%
|
||||
|
||||
for /f %%y in (%TEMP_LIST%) do (
|
||||
echo %%y
|
||||
%BINARY% cli config folders %%y rescan-intervals set 19997
|
||||
%BINARY% cli config folders %%y fswatcher-enabled set true
|
||||
%BINARY% cli config folders %%y min-disk-free unit set GB
|
||||
)
|
||||
|
||||
|
||||
for /f %%x in (%SHARE_LIST%) do (
|
||||
echo %%x
|
||||
%BINARY% cli config devices add --device-id %%x
|
||||
for /f %%y in (%TEMP_LIST%) do (
|
||||
echo %%y
|
||||
%BINARY% cli config folders %%y devices add --device-id=%%x
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user