I run 2 PS3 Media Server instances on one box (one for each network interface, one has more than the other, etc) and I wanted to set them up to boot with an init script.
Not having a configurable config location makes it a little more difficult to do dynamically, so I patched it.
Below is a really simple patch that checks the environment for a config file before using the default
- Code: Select all
diff -ur ps3mediaserver/PMS.sh ps3mediaserver.new/PMS.sh
--- ps3mediaserver/PMS.sh 2010-04-20 16:22:13.000000000 +1000
+++ ps3mediaserver.new/PMS.sh 2010-04-20 16:31:18.000000000 +1000
@@ -2,6 +2,9 @@
DIRNAME=`dirname $0`
+# Optional path to configuration file
+# PMSCONF="/path/to/pms.conf"
+# WEBCONF="/path/to/web.conf"
# OS specific support (must be 'true' or 'false').
cygwin=false;
diff -ur ps3mediaserver/net/pms/PMS.java ps3mediaserver.new/net/pms/PMS.java
--- ps3mediaserver/net/pms/PMS.java 2010-04-20 16:19:43.000000000 +1000
+++ ps3mediaserver.new/net/pms/PMS.java 2010-04-20 16:11:03.000000000 +1000
@@ -480,7 +480,7 @@
getRootFolder(renderer).browse(files);
- File webConf = new File("WEB.conf"); //$NON-NLS-1$
+ File webConf = new File(System.getenv("WEBCONF") == null ? "WEB.conf" : System.getenv("WEBCONF")); //$NON-NLS-1$
if (webConf.exists()) {
try {
LineNumberReader br = new LineNumberReader(new InputStreamReader(new FileInputStream(webConf), "UTF-8")); //$NON-NLS-1$
diff -ur ps3mediaserver/net/pms/configuration/PmsConfiguration.java ps3mediaserver.new/net/pms/configuration/PmsConfiguration.java
--- ps3mediaserver/net/pms/configuration/PmsConfiguration.java 2010-04-20 16:19:43.000000000 +1000
+++ ps3mediaserver.new/net/pms/configuration/PmsConfiguration.java 2010-04-20 16:04:46.000000000 +1000
@@ -141,7 +141,7 @@
private static final int MAX_MAX_MEMORY_BUFFER_SIZE = 600;
- private static final String CONFIGURATION_FILENAME = "PMS.conf";
+ private static final String CONFIGURATION_FILENAME = System.getenv("PMSCONF") == null ? "PMS.conf" : System.getenv("PMSCONF");
private static final String CONFIGURATION_PATH_MAC = System.getProperty("user.home") + "/Library/Application Support/PS3 Media Server/";
private static final char LIST_SEPARATOR = ',';
private static final String KEY_FOLDERS = "folders";
