File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed
Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: open config
3+ # options: CONFIG
4+ #
5+ # The function opens/reads config files on the file system
6+
7+ src_file=$1
8+
9+ # Checking arguments
10+ if [ -z " $src_file " ]; then
11+ echo " Usage: CONFIG"
12+ exit 1
13+ fi
14+
15+ # Checking file on fs
16+ if [ ! -e " $src_file " ]; then
17+ echo " Error: $src_file file doesn't exist"
18+ exit 3
19+ fi
20+
21+ # Checking path
22+ if [ ! -z " $src_file " ]; then
23+ rpath=$( readlink -f " $src_file " )
24+ services=" nginx|apache|httpd|php|ftp|bind|named|exim|dovecot|spamassassin"
25+ services=" $services |clam|mysql|postgresql|pgsql|cron|ssh|fail2ban|iptables"
26+ services=" $services |my.cnf"
27+ spath=$( echo " $rpath " | egrep " $services " )
28+ if [ -z " $spath " ]; then
29+ echo " Error: invalid source path $src_file "
30+ exit 2
31+ fi
32+ spath=$( echo " $rpath " | egrep " /etc|/var/lib" )
33+ if [ -z " $spath " ]; then
34+ echo " Error: invalid source path $src_file "
35+ exit 2
36+ fi
37+ fi
38+
39+ # Reading conf
40+ cat " $src_file " 2> /dev/null
41+ if [ $? -ne 0 ]; then
42+ echo " Error: file $src_file was not opened"
43+ exit 3
44+ fi
45+
46+ # Exiting
47+ exit
Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ mv $HESTIA/bin/v-get-fs-file-type $HESTIA_BACKUP/bin/
8686mv $HESTIA /bin/v-list-fs-directory $HESTIA_BACKUP /bin/
8787mv $HESTIA /bin/v-move-fs-directory $HESTIA_BACKUP /bin/
8888mv $HESTIA /bin/v-move-fs-file $HESTIA_BACKUP /bin/
89- mv $HESTIA /bin/v-open-fs-config $HESTIA_BACKUP /bin/
9089mv $HESTIA /bin/v-open-fs-file $HESTIA_BACKUP /bin/
9190mv $HESTIA /bin/v-search-fs-object $HESTIA_BACKUP /bin/
9291if [ ! -d " $HESTIA_BACKUP /web" ]; then
You can’t perform that action at this time.
0 commit comments