Skip to content
Snippets Groups Projects
Commit 5bfc177c authored by Bob Mottram's avatar Bob Mottram
Browse files

Set minimum disk space free for synthing

parent 1669c0f9
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ SYNCTHING_RELEASES='https://api.github.com/repos/syncthing/syncthing/releases?pe
SYNCTHING_PORT=22000
SYNCTHING_SHARED_DATA=/var/lib/syncthing/SyncShared
SYNCTHING_USER_IDS_FILE='.syncthingids'
SYNCTHING_MIN_DISK_SPACE_FREE_PERCENT=20
SYNCTHING_SHORT_DESCRIPTION=$'File synchronization'
SYNCTHING_DESCRIPTION=$'File synchronization'
......@@ -272,6 +273,12 @@ function reconfigure_syncthing {
function upgrade_syncthing {
echo -n ''
if [ -f /root/.config/syncthing/config.xml ]; then
if ! grep -q "minDiskFree unit=\"%\">$SYNCTHING_MIN_DISK_SPACE_FREE_PERCENT<" /root/.config/syncthing/config.xml; then
sed -i "s|minDiskFree unit=.*|minDiskFree unit=\"%\">$SYNCTHING_MIN_DISK_SPACE_FREE_PERCENT</minDiskFree>|g" /root/.config/syncthing/config.xml
systemctl restart syncthing
fi
fi
}
function backup_local_syncthing {
......@@ -480,6 +487,10 @@ function install_syncthing {
function_check configure_firewall_for_syncthing
configure_firewall_for_syncthing
if [ -f /root/.config/syncthing/config.xml ]; then
sed -i "s|minDiskFree unit=.*|minDiskFree unit=\"%\">$SYNCTHING_MIN_DISK_SPACE_FREE_PERCENT</minDiskFree>|g" /root/.config/syncthing/config.xml
fi
APP_INSTALLED=1
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment