|
6 | 6 | # |
7 | 7 | # Replace Hestia logos with User created logo's |
8 | 8 |
|
9 | | -download=${1-no} |
10 | 9 | #----------------------------------------------------------# |
11 | 10 | # Variables & Functions # |
12 | 11 | #----------------------------------------------------------# |
13 | 12 |
|
14 | 13 | # Argument definition |
15 | | -restart=$1 |
16 | | -skip=$2 |
| 14 | +download=${1-no} |
| 15 | +reset=${2-no} |
17 | 16 |
|
18 | 17 | # Includes |
19 | 18 | # shellcheck source=/etc/hestiacp/hestia.conf |
20 | 19 | source /etc/hestiacp/hestia.conf |
21 | 20 | # shellcheck source=/usr/local/hestia/func/main.sh |
22 | | -source $HESTIA/func/main.sh |
| 21 | +source "$HESTIA/func/main.sh" |
23 | 22 | # load config file |
24 | 23 | source_conf "$HESTIA/conf/hestia.conf" |
25 | 24 |
|
26 | 25 | #----------------------------------------------------------# |
27 | 26 | # Action # |
28 | 27 | #----------------------------------------------------------# |
29 | 28 |
|
| 29 | +if [ "$reset" = "yes" ]; then |
| 30 | + rm -rf "$HESTIA/web/images/custom/" |
| 31 | +fi |
| 32 | + |
30 | 33 | if [ -f "$HESTIA/web/images/custom/logo.svg" ]; then |
31 | | - cp -f $HESTIA/web/images/custom/logo.svg $HESTIA/web/images/logo.svg |
| 34 | + cp -f "$HESTIA/web/images/custom/logo.svg" "$HESTIA/web/images/logo.svg" |
32 | 35 | elif [ ! -f "$HESTIA/web/images/custom/logo.svg" ] && [ "$download" = "yes" ]; then |
33 | | - download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.svg $HESTIA/web/images/logo.svg |
| 36 | + download_file "https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.svg" "$HESTIA/web/images/logo.svg" |
34 | 37 | fi |
35 | 38 |
|
36 | 39 | if [ -f "$HESTIA/web/images/custom/logo.png" ]; then |
37 | | - cp -f $HESTIA/web/images/custom/logo.png $HESTIA/web/images/logo.png |
| 40 | + cp -f $"HESTIA/web/images/custom/logo.png" "$HESTIA/web/images/logo.png" |
38 | 41 | elif [ ! -f "$HESTIA/web/images/custom/logo.png" ] && [ "$download" = "yes" ]; then |
39 | | - download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.png $HESTIA/web/images/logo.png |
| 42 | + download_file "https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo.png" "$HESTIA/web/images/logo.png" |
40 | 43 | fi |
41 | 44 |
|
42 | 45 | if [ -f "$HESTIA/web/images/custom/logo-header.svg" ]; then |
43 | | - cp -f $HESTIA/web/images/custom/logo-header.svg $HESTIA/web/images/logo-header.svg |
| 46 | + cp -f "$HESTIA/web/images/custom/logo-header.svg" "$HESTIA/web/images/logo-header.svg" |
44 | 47 | elif [ ! -f "$HESTIA/web/images/custom/logo-header.svg" ] && [ "$download" = "yes" ]; then |
45 | | - download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo-header.svg $HESTIA/web/images/logo-header.svg |
| 48 | + download_file "https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/logo-header.svg" "$HESTIA/web/images/logo-header.svg" |
46 | 49 | fi |
47 | 50 |
|
48 | 51 | if [ -f "$HESTIA/web/images/custom/favicon.png" ]; then |
49 | | - cp -f $HESTIA/web/images/custom/favicon.png $HESTIA/web/images/favicon.png |
| 52 | + cp -f" $HESTIA/web/images/custom/favicon.png" "$HESTIA/web/images/favicon.png" |
50 | 53 | elif [ ! -f "$HESTIA/web/images/custom/favicon.png" ] && [ "$download" = "yes" ]; then |
51 | | - download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/favicon.png $HESTIA/web/images/favicon.png |
| 54 | + download_file "https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/images/favicon.png" "$HESTIA/web/images/favicon.png" |
52 | 55 | fi |
53 | 56 |
|
54 | 57 | if [ -f "$HESTIA/web/images/custom/favicon.ico" ]; then |
55 | | - cp -f $HESTIA/web/images/custom/favicon.ico $HESTIA/web/favicon.ico |
| 58 | + cp -f "$HESTIA/web/images/custom/favicon.ico" "$HESTIA/web/favicon.ico" |
56 | 59 | elif [ ! -f "$HESTIA/web/images/custom/favicon.ico" ] && [ "$download" = "yes" ]; then |
57 | | - download_file https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/favicon.ico $HESTIA/web/favicon.ico |
| 60 | + download_file "https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/favicon.ico" "$HESTIA/web/favicon.ico" |
58 | 61 | fi |
59 | 62 |
|
60 | 63 | #----------------------------------------------------------# |
|
0 commit comments