forked from joncutrer/perfectrestore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperfectrestore.rsc
48 lines (37 loc) · 1.54 KB
/
perfectrestore.rsc
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
#
# perfectrestore.rsc
# Version: 0.1.1
# Author: Jonathan Cutrer
# License: MIT
# Project: https://github.com/joncutrer/perfectrestore
#
{
:local targetfile "flash/backup.rsc"
# Wait for interfaces to initialize
:delay 15s
# Beep Functions
:local doStartBeep [:parse ":beep frequency=1000 length=300ms;:delay 150ms;:beep frequency=1500 length=300ms;"];
:local doFinishBeep [:parse ":beep frequency=1000 length=.6;:delay .5s;:beep frequency=1600 length=.6;:delay .5s;:beep frequency=2100 length=.3;:delay .3s;:beep frequency=2500 length=.3;:delay .3s;:beep frequency=2400 length=1;
"];
# Setup temporary logging to disk
/system logging action add disk-file-count=1 disk-file-name=flash/perfectrestore.log disk-lines-per-file=4096 name=perfectrestore target=disk
/system logging add action=perfectrestore topics=system,info
/system logging add action=perfectrestore topics=script,info
/system logging add action=perfectrestore topics=warning
/system logging add action=perfectrestore topics=error
/system logging add action=perfectrestore topics=critical
/system logging add action=perfectrestore topics=debug
# Play Audible Start Sequence
$doStartBeep
# Import the rsc file
:log info "BEGIN IMPORT file=$targetfile"
import $targetfile
:log info "END IMPORT file=$targetfile"
# Post import delay
:delay 10s
# Play Audible Finish Sequence
$doFinishBeep
# Teardown temporary logging to disk
/system logging remove [/system logging find where action=perfectrestore]
/system logging action remove [/system logging action find where name=perfectrestore]
}