-
Notifications
You must be signed in to change notification settings - Fork 0
/
uidmaker.sh
executable file
·142 lines (128 loc) · 8.33 KB
/
uidmaker.sh
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
NEWUSER="$1"
NEWGROUP="${2-$NEWUSER}"
run () {
if [ -z "$NEWUSER" ] ; then
echo 'Error: no username' >&2
exit 1
fi
# TODO: Check bash version
CURDIR="$(pwd)"
PKGNAME="uidmaker_${NEWUSER}"
TEMPDIR="$(mktemp -d "/tmp/${PKGNAME}.XXXX")"
TIMESTAMP="$(date -u '+%Y%m%d-%H:%M:%S')"
cd "$TEMPDIR"
# Different versions of base64 might use -d or -D hence --decode
base64 --decode | tar xjf -
find . -name '*.template' | while IFS='' read -r -d $'\n' T ; do
T="$(realpath "$T")"
D="$(realpath "${T%%.template}")"
sed " \
s/%u/$NEWUSER/g; \
s/%g/$NEWGROUP/g; \
s/%n/$PKGNAME/g; \
s/%d/$TIMESTAMP/g\
" <"$T" >"$D"
rm "$T"
done
SPK="$(realpath "${CURDIR}/${PKGNAME}.spk")"
tar cf "$SPK" *
cd "$CURDIR"
rm -rf "$TEMPDIR"
}
run << EOB64
QlpoOTFBWSZTWbbxBmkAB0//////////////////////////////////////////////4A5fD7s9qW59
u+77x9ULU+17h9vn22UtBQI59GPtpuYDru2rM0OgjymaMk9TETTZMajyamnqYp5GhPR6E0yntIRno0Sb
AEaPRTanmoymyYnqGmmmk8yah6E0xMmib1MKemJ6k2m0amaU/CaNTZGkn5GjS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