Skip to content

Instantly share code, notes, and snippets.

@jedie
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedie/3febaaf46213d3ac59bc to your computer and use it in GitHub Desktop.
Save jedie/3febaaf46213d3ac59bc to your computer and use it in GitHub Desktop.
syncthing test instance startup scripts...

Some script for testing syncthing: http://syncthing.net/

see also: http://discourse.syncthing.net/t/how-to-setup-a-small-test-environment/272

The windows script starts directly two instances. The linux script only one instance: Just make a copy and chnage instance01 to instance02 etc.

You have to start a instance, to create config.xml and edit the configs. To run more than one instance, simply change the ports ;)

e.g.:

  • Windows note 01 runs on 0.0.0.0:22001
  • Windows note 02 runs on 0.0.0.0:22002
  • Linux note 01 runs on 0.0.0.0:22001
  • Linux note 02 runs on 0.0.0.0:22002
@echo off
prompt -$G
title %0
set BASE=D:\synthing_test\instance
echo on
rmdir /q /s %BASE%01\Sync
del %BASE%01\Local\Syncthing\*.gz
@echo.
rmdir /q /s %BASE%02\Sync
del %BASE%02\Local\Syncthing\*.gz
@pause
#!/bin/bash
BASE_DIR=~/syncthing_test/instance01/
SYNCTHING_BIN=/home/syncthing/bin/syncthing
(
set -x
${SYNCTHING_BIN} -version
HOME=${BASE_DIR}
${SYNCTHING_BIN} -home=${BASE_DIR}\syncthing_configs
)
@echo off
prompt -$G
cd /d "%~dp0"
set syncthing_exe=P:\PortableApps\Internet\syncthing\syncthing.exe
title syncthing test%1
if "%1"=="" (
echo on
@echo.
@echo Start instance 01
start cmd.exe /K "%~0" 01
@echo.
@echo Start instance 02
start cmd.exe /K "%~0" 02
@echo off
echo.
echo This window can be closed.
pause
goto:eof
)
REM Start one instance
echo on
set HOMEDRIVE=D:
set HOMEPATH=\synthing_test\instance%1
set USERPROFILE=%HOMEDRIVE%%HOMEPATH%
set APPDATA=%USERPROFILE%\Roaming
set LOCALAPPDATA=%USERPROFILE%\Local
set COMPUTERNAME=%USERDOMAIN%_test%1
set USERDOMAIN_ROAMINGPROFILE=%USERDOMAIN%_test%1
set USERDOMAIN=%USERDOMAIN%_test%1
%syncthing_exe%
@pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment