forked from thexkey/WinampLinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
107 lines (86 loc) · 2.07 KB
/
Copy pathsetup.sh
File metadata and controls
107 lines (86 loc) · 2.07 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
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
#!/usr/bin/env bash
function main() {
clear
echo "WinampLinux - Winamp for Linux"
echo "1 - Install Winamp 5.8 (Build 3660)"
echo "2 - Run WINE Configuration (Of Winamp)"
echo "3 - Uninstall Winamp"
echo "4 - Exit "
echo "https://github.com/samdisk11/WinampLinux"
#read inputs
read_input
let answer=$?
case "$answer" in
1)
echo "Install Winamp 5.8 ..."
echo -n "using winetricks for component installation..."
run_script "scripts/WinampSetup.sh" "WinampSetup.sh"
;;
2)
echo "Run WINE Configuration ..."
echo -n "open virtualdrive configuration..."
run_script "scripts/winecfg.sh" "winecfg.sh"
;;
3)
echo -n "Remove Winamp ..."
run_script "scripts/uninstaller.sh" "uninstaller.sh"
;;
4)
echo "Exit setup..."
exitScript
;;
esac
}
#argumaents 1=script_path 2=script_name
function run_script() {
local script_path=$1
local script_name=$2
wait_second 5
if [ -f "$script_path" ];then
echo "$script_path Found..."
chmod +x "$script_path"
else
error "$script_name not Found..."
fi
cd "./scripts/" && bash $script_name
unset script_path
}
function wait_second() {
for (( i=0 ; i<$1 ; i++ ));do
echo -n "."
sleep 1
done
echo ""
}
function read_input() {
while true ;do
read -p "[choose an option]$ " choose
if [[ "$choose" =~ (^[1-4]$) ]];then
break
fi
warning "choose a number between 1 to 4"
done
return $choose
}
function exitScript() {
echo "Exiting..."
}
function banner() {
local banner_path="$PWD/images/banner"
if [ -f $banner_path ];then
clear && echo ""
cat $banner_path
echo ""
else
error "banner not Found..."
fi
unset banner_path
}
function error() {
echo -e "\033[1;31merror:\e[0m $@"
exit 1
}
function warning() {
echo -e "\033[1;33mWarning:\e[0m $@"
}
main