-
Notifications
You must be signed in to change notification settings - Fork 1
/
retroinstaller.sh
executable file
·39 lines (38 loc) · 1.08 KB
/
retroinstaller.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
#/bin/bash
function is_missing_dialog_pkg() {
if [ ! -f /usr/bin/dialog ]; then
while true; do
read -p "Missing 'dialog' package. Do you wish to let me try to install it for you? (aprox. 1.3 kB) [y/n] " yn
case $yn in
[Yy]*)
sudo apt install -y dialog
break
;;
[Nn]*)
echo "Please install 'dialog' package to continue."
exit 1
;;
*) echo "Please answer (y)es or (n)o." ;;
esac
done
fi
}
is_missing_dialog_pkg
while true; do
seleccion=$(./commonscripts/menugen.sh $1 | tr '[:upper:]' '[:lower:]')
if [ $seleccion == "exit" ] || [ -z "$seleccion" ]; then
clear
break
fi
if [ -f "./menus/${seleccion}.txt" ]; then
./retroinstaller.sh $seleccion
else
mkdir opt
clear
echo ">>> Installing ${seleccion}..."
cd opt
../installers/${seleccion}_installer.sh
../commonscripts/warninggen.sh ${seleccion}
cd ..
fi
done