File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11dest=" mytonctrl_backup_$( hostname) _$( date +%s) .tar.gz"
22mtc_dir=" $HOME /.local/share/mytoncore"
33user=$( logname)
4+ ton_dir=" /var/ton-work"
45# Get arguments
5- while getopts d:m: flag
6+ while getopts d:m:t: flag
67do
78 case " ${flag} " in
89 d) dest=${OPTARG} ;;
910 m) mtc_dir=${OPTARG} ;;
11+ t) ton_dir=${OPTARG} ;;
1012 * )
1113 echo " Flag -${flag} is not recognized. Aborting"
1214 exit 1 ;;
@@ -26,9 +28,9 @@ rm -rf $tmp_dir
2628mkdir $tmp_dir
2729mkdir $tmp_dir /db
2830
29- cp /var/ton-work /db/config.json ${tmp_dir} /db
30- cp -r /var/ton-work /db/keyring ${tmp_dir} /db
31- cp -r /var/ton-work /keys ${tmp_dir}
31+ cp $ton_dir /db/config.json ${tmp_dir} /db
32+ cp -r $ton_dir /db/keyring ${tmp_dir} /db
33+ cp -r $ton_dir /keys ${tmp_dir}
3234cp -r $mtc_dir $tmp_dir
3335
3436python3 -c " import json;f=open('${tmp_dir} /db/config.json');json.load(f);f.close()" || exit 1 # Check if config.json is copied correctly
You can’t perform that action at this time.
0 commit comments