Skip to content

Commit

Permalink
add option to launch with no-avahi tag (safe mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Feb 17, 2018
1 parent 2f06767 commit 29dacef
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
3 changes: 2 additions & 1 deletion INFO.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source /pkgscripts/include/pkg_util.sh

package="HomebridgeDocker"
version="1.0.5"
version="1.0.6"
maintainer="oznu"
displayname="Homebridge Docker"
description="HomeKit support for the impatient using Docker on Synology DSM."
Expand All @@ -16,6 +16,7 @@ install_dep_packages="Docker>=1.11.2"
dsmuidir="ui"
dsmappname="oznu.homebridge"
silent_install="no"
silent_upgrade="no"
qinst="false"
adminprotocol="http"
adminurl=""
Expand Down
18 changes: 17 additions & 1 deletion WIZARD_UIFILES/install_uifile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@
}
}
}]
}]
}]
}, {
"step_title": "Run Homebridge In Safe Mode?",
"invalid_next_disable": true,
"items": [{
"type": "singleselect",
"desc": "Would you like to run Homebridge in safe mode? If you're having trouble discovering Homebridge on your iOS device after setup you should reinstall using safe mode, beware a small number of plugins will not work properly in safe mode.",
"subitems": [{
"key": "homebridge_pkgwizard_no_avahi_false",
"desc": "No - Install the normal version of Homebridge Docker.",
"defaultValue": true
}, {
"key": "homebridge_pkgwizard_no_avahi_true",
"desc": "Yes - Install in safe mode. Select this if you're having trouble finding Homebridge.",
"defaultValue": false
}]
}]
}, {
"step_title": "Homebridge Config UI X",
"invalid_next_disable": true,
Expand Down
17 changes: 17 additions & 0 deletions WIZARD_UIFILES/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[{
"step_title": "Run Homebridge In Safe Mode?",
"invalid_next_disable": true,
"items": [{
"type": "singleselect",
"desc": "Would you like to run Homebridge in safe mode? If you're having trouble discovering Homebridge on your iOS device after setup you should reinstall using safe mode, beware a small number of plugins will not work properly in safe mode.",
"subitems": [{
"key": "homebridge_pkgwizard_no_avahi_false",
"desc": "No - Install the normal version of Homebridge Docker.",
"defaultValue": true
}, {
"key": "homebridge_pkgwizard_no_avahi_true",
"desc": "Yes - Install in safe mode. Select this if you're having trouble finding Homebridge.",
"defaultValue": false
}]
}]
}]
7 changes: 7 additions & 0 deletions scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if [ "$SYNOPKG_PKG_STATUS" = "INSTALL" ]; then
[ -f $SYNOPKG_PKGDEST/ui/config ] && mv $SYNOPKG_PKGDEST/ui/config $SYNOPKG_PKGDEST/ui/config.disabled
fi

# Enable safe mode if requested
if [ "$homebridge_pkgwizard_no_avahi_true" = "true" ]; then
sed -i 's/homebridge:latest/homebridge:no-avahi/g' $SYNOPKG_PKGDEST/docker-compose.yml
else
sed -i 's/homebridge:no-avahi/homebridge:latest/g' $SYNOPKG_PKGDEST/docker-compose.yml
fi

chmod 755 $homebridge_pkgwizard_share_name
fi

Expand Down
7 changes: 7 additions & 0 deletions scripts/postupgrade
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@

cp $SYNOPKG_TEMP_UPGRADE_FOLDER/.env $SYNOPKG_PKGDEST/.env

# Enable safe mode if requested
if [ "$homebridge_pkgwizard_no_avahi_true" = "true" ]; then
sed -i 's/homebridge:latest/homebridge:no-avahi/g' $SYNOPKG_PKGDEST/docker-compose.yml
else
sed -i 's/homebridge:no-avahi/homebridge:latest/g' $SYNOPKG_PKGDEST/docker-compose.yml
fi

exit 0

0 comments on commit 29dacef

Please sign in to comment.