-
Notifications
You must be signed in to change notification settings - Fork 16
/
_image.sh
51 lines (40 loc) · 1.52 KB
/
_image.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
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
# BAD INPUT
badinput () {
echo
read -p '⛔️ ERROR - BAD INPUT! | PRESS [ENTER] ' typed < /dev/tty
question1
}
# FUNCTION - ONE
question1 () {
# Recall Program
image=$(cat /pg/tmp/program_var)
# Checks Image List
file="/pg/apps/programs/$image/image.sh"
if [ ! -e "$file" ]; then exit; fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌵 PG Multi Image Selector - $image
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
count=1
while read p; do
echo "$count - $p"
echo "$p" > /pg/tmp/display$count
count=$[count+1]
done </pg/apps/programs/$image/image.sh
echo ""
read -p '🚀 Type Number | PRESS [ENTER]: ' typed < /dev/tty
if [[ "$typed" -ge "1" && "$typed" -lt "$count" ]]; then
mkdir -p /pg/var/image
cat "/pg/tmp/display$typed" > "/pg/var/image/$image"
else badinput; fi
}
# END OF FUNCTIONS ############################################################
question1