File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# info: add cron job for hestia autoupdates
3- # options: NONE
3+ # options: MODE
44#
5- # The function adds cronjob for hestia autoupdate.
5+ # The function adds cronjob for hestia autoupdate from apt or git .
66
77
88# ----------------------------------------------------------#
1111
1212# Argument definition
1313user=admin
14-
14+ mode= $1
1515# Includes
1616source $HESTIA /func/main.sh
1717source $HESTIA /conf/hestia.conf
@@ -43,12 +43,24 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
4343date=$( echo " $time_n_date " | cut -f 2 -d \ )
4444
4545# Define time somewhere at night
46- min=$( generate_password ' 012345' ' 2' )
47- hour=$( generate_password ' 1234567' ' 1' )
48- day=' *'
49- month=' *'
50- wday=' *'
51- command=' sudo /usr/local/hestia/bin/v-update-sys-hestia-all'
46+
47+
48+ if [ -z " $mode " ] || [ " $mode " = " apt" ]; then
49+ min=$( generate_password ' 012345' ' 2' )
50+ hour=$( generate_password ' 1234567' ' 1' )
51+ day=' *'
52+ month=' *'
53+ wday=' *'
54+ command=' sudo /usr/local/hestia/bin/v-update-sys-hestia-all'
55+ fi
56+ if [ " $mode " = " git" ]; then
57+ min=' 0'
58+ hour=' 0'
59+ day=' *'
60+ month=' *'
61+ wday=' *'
62+ command=' sudo /usr/local/hestia/bin/v-update-sys-hestia-git'
63+ fi
5264
5365# Concatenating cron string
5466str=" JOB='$job ' MIN='$min ' HOUR='$hour ' DAY='$day ' MONTH='$month ' WDAY='$wday '"
Original file line number Diff line number Diff line change 77# - Will download from the hestiacp repository
88# - Pulls code from staging/beta branch
99# - install: installs package immediately
10+ # - install-auto: installs package and schedules automatic updates from Git
1011# - 'all': (optional) - compiles nginx and php alongside panel.
1112# this option takes a long time, only use when needed
1213
@@ -421,7 +422,7 @@ install_build() {
421422
422423# Define installation routine
423424
424- if [ " $install " = " install" ] || [ " $install " = " yes" ]; then
425+ if [ " $install " = " install" ] || [ " $install " = " yes" ] || [ " $install " = " install-auto " ] ; then
425426 install_build
426427else
427428 warning_message
You can’t perform that action at this time.
0 commit comments