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" echo "done"
} 2>$LOGFILE } 2>$LOGFILE
function UpdateXOAutomate {
case "$1" in
--update)
UpdateXO
;;
*)
StartUpScreen
;;
esac
}
function CheckOS { function CheckOS {
if [ -f /etc/centos-release ] ; then 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 "- 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 "- Option 2. actually creates a new build from sources but works as an update to installations originally done with this tool"
echo 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 "Following options will be used for installation:"
echo echo
echo "OS: $OSNAME $OSVERSION" echo "OS: $OSNAME $OSVERSION"
@@ -434,4 +448,10 @@ esac
CheckUser CheckUser
CheckOS CheckOS
CheckSystemd CheckSystemd
StartUpScreen
if [[ $# == "1" ]]; then
UpdateXOAutomate "$1"
exit 0
else
StartUpScreen
fi