feat: add support for SVR.JS zip archives with "svrjs.yaml" file
This commit is contained in:
parent
155ff2471c
commit
3a02d9b051
1 changed files with 8 additions and 2 deletions
|
@ -170,8 +170,14 @@ if [ -f /usr/lib/svrjs/svr.compressed ]; then
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
ln -s /usr/lib/svrjs/log /var/log/svrjs
|
ln -s /usr/lib/svrjs/log /var/log/svrjs
|
||||||
|
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
|
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
|
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
|
if [ -d /usr/lib/svrjs/wwwroot ]; then
|
||||||
mkdir -p /var/www
|
mkdir -p /var/www
|
||||||
mv /usr/lib/svrjs/wwwroot /var/www/svrjs
|
mv /usr/lib/svrjs/wwwroot /var/www/svrjs
|
||||||
|
|
Loading…
Reference in a new issue