-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.liddle
More file actions
executable file
·82 lines (50 loc) · 1.79 KB
/
save.liddle
File metadata and controls
executable file
·82 lines (50 loc) · 1.79 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/scripts/working/Liddle
function save {
save_core=0
save_vars=0
save_args=0
# If there are variables in the core variable array
if [ ! ${#core[@]} == 0 ]; then
# Save the Variables
for i in ${!core[@]}
do
if [ $save_core == 0 ]; then
echo "declare -A core" > ${core[DIR]}${core[PROGNAME]}.end
echo "core[$i]=\"${core[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
save_core=1
else
echo "core[$i]=\"${core[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
fi
done
fi
# If there are variables in the vars array
if [ ! ${#vars[@]} == 0 ]; then
# Save the Normal Variables
for i in ${!vars[@]}
do
if [ $save_vars == 0 ]; then
echo "declare -A vars" >> ${core[DIR]}${core[PROGNAME]}.end
echo "vars[$i]=\"${vars[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
save_vars=1
else
echo "vars[$i]=\"${vars[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
fi
done
fi
# If there are variables in the args array
if [ ! ${#args[@]} == 0 ]; then
# Save the Normal Variables
for i in ${!args[@]}
do
if [ $save_args == 0 ]; then
echo "declare -A args" >> ${core[DIR]}${core[PROGNAME]}.end
echo "args[$i]=\"${args[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
save_args=1
else
echo "args[$i]=\"${args[$i]}\"" >> ${core[DIR]}${core[PROGNAME]}.end
fi
done
fi
chmod 755 ${core[DIR]}${core[PROGNAME]}.end
}