Skip to content

Commit fc111c5

Browse files
author
Kristan Kenney
committed
Add v-update-mail-templates script
1 parent e493cb0 commit fc111c5

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

bin/v-update-mail-templates

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# info: update mail templates
3+
# options: [RESTART]
4+
#
5+
# The function for obtaining updated pack of mail templates.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument definition
13+
restart=$1
14+
15+
# Includes
16+
source $HESTIA/func/main.sh
17+
source $HESTIA/conf/hestia.conf
18+
19+
# Detect OS
20+
case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
21+
Debian) type="debian" ;;
22+
Ubuntu) type="ubuntu" ;;
23+
*) type="NoSupport" ;;
24+
esac
25+
26+
# Detect version
27+
if [ "$type" = "ubuntu" ] || [ "$type" = "debian" ]; then
28+
type="deb"
29+
else
30+
echo "Error: can't detect supported os"
31+
log_event "$E_NOTEXIST"
32+
exit $E_NOTEXIST
33+
fi
34+
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
# Update templates
41+
cp -rf $HESTIA/install/$type/templates/mail $HESTIA/data/templates/
42+
43+
#----------------------------------------------------------#
44+
# Hestia #
45+
#----------------------------------------------------------#
46+
47+
# Restarting web server
48+
$BIN/v-restart-web $restart
49+
check_result $? "restart" >/dev/null 2>&1
50+
51+
$BIN/v-restart-proxy $restart
52+
check_result $? "restart" >/dev/null 2>&1
53+
54+
$BIN/v-restart-proxy $restart
55+
check_result $? "restart" >/dev/null 2>&1
56+
57+
exit

0 commit comments

Comments
 (0)