diff --git a/installer.sh b/installer.sh index a0045de..5b79100 100755 --- a/installer.sh +++ b/installer.sh @@ -170,8 +170,14 @@ if [ -f /usr/lib/svrjs/svr.compressed ]; then popd fi ln -s /usr/lib/svrjs/log /var/log/svrjs -ln -s /usr/lib/svrjs/config.json /etc/svrjs-config.json -node -e 'var fs=require("fs"),config=JSON.parse(fs.readFileSync("/usr/lib/svrjs/config.json").toString());config.wwwroot="/var/www/svrjs",fs.writeFileSync("/usr/lib/svrjs/config.json",JSON.stringify(config,null,2));' > /dev/null +if [ -f /usr/lib/svrjs/svrjs.yaml ]; then + ln -s /usr/lib/svrjs/svrjs.yaml /etc/svrjs.yaml + echo "global:" > /usr/lib/svrjs/svrjs.yaml + echo " wwwroot: /var/www/svrjs" >> /usr/lib/svrjs/svrjs.yaml +else + ln -s /usr/lib/svrjs/config.json /etc/svrjs-config.json + node -e 'var fs=require("fs"),config=JSON.parse(fs.readFileSync("/usr/lib/svrjs/config.json").toString());config.wwwroot="/var/www/svrjs",fs.writeFileSync("/usr/lib/svrjs/config.json",JSON.stringify(config,null,2));' > /dev/null +fi if [ -d /usr/lib/svrjs/wwwroot ]; then mkdir -p /var/www mv /usr/lib/svrjs/wwwroot /var/www/svrjs