-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-label
executable file
·39 lines (31 loc) · 1020 Bytes
/
make-label
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
#!/bin/bash
# Prompt for serial number
read -p "Please enter the first serial number in the sequence: " serial_number
# Display model number options
echo "Please select a model number:"
echo "1. AP1-S4Z6"
echo "2. AP1-S4"
echo "3. AP1-Z6"
# Prompt for model number selection
while true; do
read -p "Enter the number corresponding to your choice (1-3): " model_choice
case ${model_choice} in
1) model_number="AP1-S4Z6"; break;;
2) model_number="AP1-S4"; break;;
3) model_number="AP1-Z6"; break;;
*) echo "Invalid choice. Please enter 1, 2, or 3.";;
esac
done
read -p "How many of each label to print? [2]: " quantity
quantity=${quantity:-2}
read -p "How many sets to print in sequence? [1]: " count
count=${count:-1}
if ((count > 10 || count <= 0)) then
echo Please only print between 1 and 10 sets.
exit
fi
for i in $(seq 1 $count);
do
serial_number=$((serial_number + 1))
$(dirname $0)/label-gen "${serial_number}" "${model_number}" ${quantity}
done