forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert-templates.sh
More file actions
executable file
·51 lines (43 loc) · 1.16 KB
/
Copy pathconvert-templates.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.16 KB
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
#!/bin/bash
# Define data path
TPL='/usr/local/vesta/data/templates/web'
# Check for new template structure
if [ -e "$TPL/apache" ]; then
exit
fi
# Remove unused email template
rm -f $TPL/email_reset_password.tpl
# Apache
mkdir -p $TPL/apache
if [ ! -z "$(ls $TPL/| grep apache_)" ];then
mv $TPL/apache_* $TPL/apache/
for template in $(ls $TPL/apache/); do
new_name=$(echo $template |sed -e "s/apache_//")
mv -f $TPL/apache/$template $TPL/apache/$new_name
done
fi
# Nginx
mkdir -p $TPL/nginx
if [ ! -z "$(ls $TPL/| grep nginx_)" ];then
mv $TPL/nginx_* $TPL/nginx/
for template in $(ls $TPL/nginx/); do
new_name=$(echo $template |sed -e "s/nginx_//")
mv -f $TPL/nginx/$template $TPL/nginx/$new_name
done
fi
if [ -e "$TPL/ngingx.ip.tpl" ]; then
mv $TPL/ngingx.ip.tpl $TPL/nginx/ip.tpl
fi
# Awstats
mkdir -p $TPL/awstats
if [ -e "$TPL/awstats.tpl" ]; then
mv $TPL/awstats.tpl $TPL/awstats
mv $TPL/awstats_index.tpl $TPL/awstats/index.tpl
mv $TPL/awstats_nav.tpl $TPL/awstats/nav.tpl
fi
# Webalizer
mkdir -p $TPL/webalizer
if [ -e "$TPL/webalizer.tpl" ]; then
mv $TPL/webalizer.tpl $TPL/webalizer
fi
exit