* Default app works * static tech = default tech * cancel fixed
This commit is contained in:
parent
cd028c9e32
commit
631ad0c859
1 changed files with 14 additions and 4 deletions
|
@ -48,7 +48,9 @@ function setTech() {
|
||||||
echo "NOTE: /srv/app doesn't exists, creating it from $tech example application"
|
echo "NOTE: /srv/app doesn't exists, creating it from $tech example application"
|
||||||
mkdir -p /srv/app
|
mkdir -p /srv/app
|
||||||
cp -a /opt/examples/$name/* /srv/app/
|
cp -a /opt/examples/$name/* /srv/app/
|
||||||
test $name -eq "default" || mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf
|
if [ -e /srv/app/supervisor.conf ]; then
|
||||||
|
mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process"
|
echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process"
|
||||||
fi
|
fi
|
||||||
|
@ -98,13 +100,14 @@ function setTech() {
|
||||||
# Same thing we do for nginx but if the file exist it's not rewritten.
|
# Same thing we do for nginx but if the file exist it's not rewritten.
|
||||||
if [ ! -e /srv/conf/nginx.d/app.conf ]; then
|
if [ ! -e /srv/conf/nginx.d/app.conf ]; then
|
||||||
mkdir -p /srv/conf/nginx.d
|
mkdir -p /srv/conf/nginx.d
|
||||||
if [ "$name" = "php" ]; then
|
if [ -e /opt/examples/$tech/nginx.conf ]; then
|
||||||
cp /opt/examples/php/nginx.conf /srv/conf/nginx.d/app.conf
|
cp /opt/examples/$tech/nginx.conf /srv/conf/nginx.d/app.conf
|
||||||
|
rm /srv/app/nginx.conf
|
||||||
else
|
else
|
||||||
cp /opt/examples/nginx/nginx.conf /srv/conf/nginx.d/app.conf
|
cp /opt/examples/nginx/nginx.conf /srv/conf/nginx.d/app.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ".. app configuration for nginx not found, adding it - please check /srv/conf/nginx.d/app.conf and make sure it fits your code"
|
echo ".. app configuration for nginx not found, adding it - please check /srv/conf/nginx.d/app.conf and make sure it fits your code"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We load new configuration into supervisor and it's automatically started or restarted if needed
|
# We load new configuration into supervisor and it's automatically started or restarted if needed
|
||||||
|
@ -208,6 +211,9 @@ function quickTech() {
|
||||||
"default")
|
"default")
|
||||||
setTech $TECH
|
setTech $TECH
|
||||||
;;
|
;;
|
||||||
|
"static")
|
||||||
|
setTech default
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +240,10 @@ while /bin/true; do
|
||||||
menuitem=$MENUITEM
|
menuitem=$MENUITEM
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
case $menuitem in
|
case $menuitem in
|
||||||
# Activation of one of the available tech
|
# Activation of one of the available tech
|
||||||
# Only one tech can be enabled same time but it's possible to use any of them from /opt/techs
|
# Only one tech can be enabled same time but it's possible to use any of them from /opt/techs
|
||||||
|
|
Loading…
Reference in a new issue