@@ -16,36 +16,31 @@ restart=$1
1616source $HESTIA /func/main.sh
1717source $HESTIA /conf/hestia.conf
1818
19-
20- # ----------------------------------------------------------#
21- # Action #
22- # ----------------------------------------------------------#
23-
24- # Detcing OS
25- case $( head -n1 /etc/issue | cut -f 1 -d ' ' ) in
26- Debian) version=" debian" ;;
27- Ubuntu) version=" ubuntu" ;;
28- * ) version=" NotSupported" ;;
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" ;;
2924esac
3025
31- # Detecting release
32- if [ " $version " = ' ubuntu' ]; then
33- release=$( lsb_release -r | awk ' {print $2}' )
34- fi
35- if [ " $version " = ' debian' ]; then
36- release=$( cat /etc/issue| grep -o [0-9]| head -n1)
37- fi
38- if [ " $version " = ' NotSupported' ]; then
39- echo " No Supported OS Version found, abort."
40- exit 1
26+ # Detect version
27+ if [ " $type " = " ubuntu" ]; then
28+ release=" $( lsb_release -s -r) "
29+ elif [ " $type " = " ubuntu" ]; then
30+ release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
31+ else
32+ echo " Error: can't detect supported os"
33+ log_event " $E_NOTEXIST "
34+ exit $E_NOTEXIST
4135fi
4236
43- # Defining template path
44- hestiacp=" $HESTIA /install/$version /$release "
4537
46- # Updating templates
47- cp -rf $hestiacp /templates/web $HESTIA /data/templates/
38+ # ----------------------------------------------------------#
39+ # Action #
40+ # ----------------------------------------------------------#
4841
42+ # Update templates
43+ cp -rf $HESTIA /install/$type /$release /templates/web $HESTIA /data/templates/
4944
5045# Rebuilding web domains
5146for user in $( $BIN /v-list-sys-users plain) ; do
0 commit comments