Add option to run update in non-interactive mode

This commit is contained in:
ronivay
2018-06-08 22:28:56 +03:00
parent 4446263123
commit 2c58dbf85b

View File

@@ -264,6 +264,18 @@ function UpdateXO {
echo "done"
} 2>$LOGFILE
function UpdateXOAutomate {
case "$1" in
--update)
UpdateXO
;;
*)
StartUpScreen
;;
esac
}
function CheckOS {
if [ -f /etc/centos-release ] ; then
@@ -321,6 +333,8 @@ echo
echo "- Data stored in redis and /var/lib/xo-server/data will not be touched"
echo "- Option 2. actually creates a new build from sources but works as an update to installations originally done with this tool"
echo
echo "- To run option 2. without interactive mode (as cronjob for automated updates for example) use --update"
echo
echo "Following options will be used for installation:"
echo
echo "OS: $OSNAME $OSVERSION"
@@ -434,4 +448,10 @@ esac
CheckUser
CheckOS
CheckSystemd
if [[ $# == "1" ]]; then
UpdateXOAutomate "$1"
exit 0
else
StartUpScreen
fi