Skip to content

Commit 872df51

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/single-item-restore-cli' into main
2 parents 811d8db + 7cf96f4 commit 872df51

File tree

5 files changed

+240
-0
lines changed

5 files changed

+240
-0
lines changed

bin/v-restore-cron-job

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# info: restore single cron job
3+
# options: USER BACKUP DOMAIN [NOTIFY]
4+
# labels: panel
5+
#
6+
# example: v-restore-cron-job USER BACKUP CRON [NOTIFY]
7+
#
8+
# The function allows the user to restore a single cron job
9+
# from a backup archive.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
user=$1
17+
backup=$2
18+
cronjob=$3
19+
notify=$4
20+
21+
# Includes
22+
source $HESTIA/func/main.sh
23+
source $HESTIA/conf/hestia.conf
24+
25+
# Perform verification if read-only mode is enabled
26+
check_hestia_demo_mode
27+
28+
#----------------------------------------------------------#
29+
# Verifications #
30+
#----------------------------------------------------------#
31+
32+
args_usage='USER BACKUP CRON [NOTIFY]'
33+
check_args '3' "$#" "$args_usage"
34+
is_format_valid 'user' 'backup'
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
$BIN/v-restore-user $user $backup 'no' 'no' 'no' 'no' $cronjob 'no' $notify
41+
42+
#----------------------------------------------------------#
43+
# Hestia #
44+
#----------------------------------------------------------#
45+
46+
log_event "$OK" "$ARGUMENTS"
47+
48+
exit

bin/v-restore-database

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# info: restore single database
3+
# options: USER BACKUP DOMAIN [NOTIFY]
4+
# labels: panel
5+
#
6+
# example: v-restore-web-domain USER BACKUP DATABASE [NOTIFY]
7+
#
8+
# The function allows the user to restore a single database
9+
# from a backup archive.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
user=$1
17+
backup=$2
18+
database=$3
19+
notify=$4
20+
21+
# Includes
22+
source $HESTIA/func/main.sh
23+
source $HESTIA/conf/hestia.conf
24+
25+
# Perform verification if read-only mode is enabled
26+
check_hestia_demo_mode
27+
28+
#----------------------------------------------------------#
29+
# Verifications #
30+
#----------------------------------------------------------#
31+
32+
args_usage='USER BACKUP DOMAIN [NOTIFY]'
33+
check_args '3' "$#" "$args_usage"
34+
is_format_valid 'user' 'backup'
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
$BIN/v-restore-user $user $backup 'no' 'no' 'no' $database 'no' 'no' $notify
41+
42+
#----------------------------------------------------------#
43+
# Hestia #
44+
#----------------------------------------------------------#
45+
46+
log_event "$OK" "$ARGUMENTS"
47+
48+
exit

bin/v-restore-dns-domain

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# info: restore single dns domain
3+
# options: USER BACKUP DOMAIN [NOTIFY]
4+
# labels: panel
5+
#
6+
# example: v-restore-web-domain USER BACKUP DOMAIN [NOTIFY]
7+
#
8+
# The function allows the user to restore a single DNS domain
9+
# from a backup archive.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
user=$1
17+
backup=$2
18+
domain=$3
19+
notify=$4
20+
21+
# Includes
22+
source $HESTIA/func/main.sh
23+
source $HESTIA/conf/hestia.conf
24+
25+
# Perform verification if read-only mode is enabled
26+
check_hestia_demo_mode
27+
28+
#----------------------------------------------------------#
29+
# Verifications #
30+
#----------------------------------------------------------#
31+
32+
args_usage='USER BACKUP DOMAIN [NOTIFY]'
33+
check_args '3' "$#" "$args_usage"
34+
is_format_valid 'user' 'backup'
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
$BIN/v-restore-user $user $backup 'no' $domain 'no' 'no' 'no' 'no' $notify
41+
42+
#----------------------------------------------------------#
43+
# Hestia #
44+
#----------------------------------------------------------#
45+
46+
log_event "$OK" "$ARGUMENTS"
47+
48+
exit

bin/v-restore-mail-domain

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# info: restore single mail domain
3+
# options: USER BACKUP DOMAIN [NOTIFY]
4+
# labels: panel
5+
#
6+
# example: v-restore-web-domain USER BACKUP DOMAIN [NOTIFY]
7+
#
8+
# The function allows the user to restore a single mail domain
9+
# from a backup archive.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
user=$1
17+
backup=$2
18+
domain=$3
19+
notify=$4
20+
21+
# Includes
22+
source $HESTIA/func/main.sh
23+
source $HESTIA/conf/hestia.conf
24+
25+
# Perform verification if read-only mode is enabled
26+
check_hestia_demo_mode
27+
28+
#----------------------------------------------------------#
29+
# Verifications #
30+
#----------------------------------------------------------#
31+
32+
args_usage='USER BACKUP DOMAIN [NOTIFY]'
33+
check_args '3' "$#" "$args_usage"
34+
is_format_valid 'user' 'backup'
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
$BIN/v-restore-user $user $backup 'no' 'no' $domain 'no' 'no' 'no' $notify
41+
42+
#----------------------------------------------------------#
43+
# Hestia #
44+
#----------------------------------------------------------#
45+
46+
log_event "$OK" "$ARGUMENTS"
47+
48+
exit

bin/v-restore-web-domain

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# info: restore single web domain
3+
# options: USER BACKUP DOMAIN [NOTIFY]
4+
# labels: panel
5+
#
6+
# example: v-restore-web-domain USER BACKUP DOMAIN [NOTIFY]
7+
#
8+
# The function allows the user to restore a single web domain
9+
# from a backup archive.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Argument definition
16+
user=$1
17+
backup=$2
18+
domain=$3
19+
notify=$4
20+
21+
# Includes
22+
source $HESTIA/func/main.sh
23+
source $HESTIA/conf/hestia.conf
24+
25+
# Perform verification if read-only mode is enabled
26+
check_hestia_demo_mode
27+
28+
#----------------------------------------------------------#
29+
# Verifications #
30+
#----------------------------------------------------------#
31+
32+
args_usage='USER BACKUP DOMAIN [NOTIFY]'
33+
check_args '3' "$#" "$args_usage"
34+
is_format_valid 'user' 'backup'
35+
36+
#----------------------------------------------------------#
37+
# Action #
38+
#----------------------------------------------------------#
39+
40+
$BIN/v-restore-user $user $backup $domain 'no' 'no' 'no' 'no' 'no' $notify
41+
42+
#----------------------------------------------------------#
43+
# Hestia #
44+
#----------------------------------------------------------#
45+
46+
log_event "$OK" "$ARGUMENTS"
47+
48+
exit

0 commit comments

Comments
 (0)