-
-
Notifications
You must be signed in to change notification settings - Fork 675
/
v-update-sys-hestia
executable file
·56 lines (41 loc) · 1.59 KB
/
v-update-sys-hestia
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# info: update hestia package/configs
# options: PACKAGE
# labels: panel
#
# example: v-update-sys-hestia hestia-php
#
# The function runs as apt update trigger. It pulls shell script from hestia
# server and runs it. (hestia, hestia-nginx and hestia-php are valid options)
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
package=$1
# Importing system environment
source /etc/profile
# Includes
source $HESTIA/func/main.sh
source $HESTIA/conf/hestia.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
# Checking arg number
check_args '1' "$#" 'PACKAGE'
# Perform verification if read-only mode is enabled
check_hestia_demo_mode
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Update repo
apt-get update -o Dir::Etc::sourcelist="sources.list.d/hestia.list" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
# Update hestia package
apt-get install $package -qq > /dev/null 2>&1
check_result $? "$package update failed" $E_UPDATE
#----------------------------------------------------------#
# Hestia #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit