-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·147 lines (129 loc) · 3.92 KB
/
install.sh
File metadata and controls
executable file
·147 lines (129 loc) · 3.92 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
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
143
144
145
146
147
#!/bin/bash
echo -e "\n \033[01mSICOOBNET EMPRESARIAL\033[00m"
echo "------------------------------------"
echo -e "\nVerificando distribuição..."
hostnamectl
basearch=('arch')
basedebian=('Mint' 'Debian' 'debian' 'Ubuntu' 'ubuntu')
parsebasearch() {
sudo pacman -Sy
sudo pacman -S wine wine-gecko wine-mono
}
parsebasedebian() {
if hostnamectl | grep "Mint" || hostnamectl | grep "Ubuntu";
then
sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
# Adiona o PPA correspondente a distribução.
if hostnamectl | grep "Ubuntu 21.04"; then
sudo add-apt-repository deb 'https://dl.winehq.org/wine-builds/ubuntu/ hirsute main'
elif hostnamectl | grep "Ubuntu 20.10"; then
sudo add-apt-repository deb 'https://dl.winehq.org/wine-builds/ubuntu/ groovy main'
elif hostnamectl | grep "Ubuntu 20.04" || hostnamectl | "Linux Mint 20"; then
sudo add-apt-repository deb 'https://dl.winehq.org/wine-builds/ubuntu/ focal main'
elif hostnamectl | grep "Ubuntu 18.04" || hostnamectl | "Linux Mint 19"; then
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
fi
fi
sudo apt-get update -y
sudo apt install --install-recommends winehq-stable
}
checkWineInstallation() {
echo -e "Buscando \033[01mWine...\033[00m"
if [ -a /usr/bin/wine ]; then
true
else
false
fi
}
checkSicoobnetInstallExists() {
if [ -e $HOME/sicoobnet-installer/instalador-sicoobnet-windows-amd64.exe ];
then
true
else
false
fi
}
downloadSicoobnetInstall() {
echo -e "\nBaixando...\n"
mkdir $HOME/sicoobnet-installer
wget -c -P $HOME/sicoobnet-installer https://office-sicoob-instalador.s3-us-west-2.amazonaws.com/instalador-sicoobnet-windows-amd64.exe
}
checkSicoobnetInstallation() {
if [ -e $HOME/.wine/drive_c/Sicoobnet/office.exe ];
then
true
else
false
fi
}
createShortcute() {
shortcute="[Desktop Entry]\nVersion=1.0\nName=Sicoobnet\nGenericName=Gerenciador Financeiro SicoobNet\nGenericName[fil]=Gerenciador Financeiro SicoobNet\nComment=Gerenciador Financeiro SicoobNet\nExec=/usr/bin/sicoobnet.sh\nTerminal=false\nIcon=$HOME/.wine/drive_c/Sicoobnet/SicoobEmp001.ico\nType=Application\nCategories=restart;Finance;"
if checkSicoobnetInstallation;
then
sudo cp run.sh /usr/bin/sicoobnet.sh
if [ -d $HOME/Desktop ]; then
echo -e $shortcute >> $HOME/Desktop/Sicoobnet.desktop
fi
if [ -d $HOME/Área\ de\ Trabalho ]; then
echo -e $shortcute >> $HOME/Área\ de\ Trabalho/Sicoobnet.desktop
fi
fi
}
runSicoobnetInstaller() {
echo -e "\n\033[01mIniciando instalação...\n\033[00m"
wine $HOME/sicoobnet-installer/instalador-sicoobnet-windows-amd64.exe
if checkSicoobnetInstallation;
then
createShortcute
fi
}
if hostnamectl | grep $basearch;
then
if checkWineInstallation; then
wine --version
echo -e "Wine encontrado...ok!"
if checkSicoobnetInstallExists;
then
if ! checkSicoobnetInstallation; then
runSicoobnetInstaller
else
echo -e "\nO \033[01mSicoobnet\033[00m já está instalado.\n"
fi
else
downloadSicoobnetInstall
if checkSicoobnetInstallExists;
then
runSicoobnetInstaller
fi
fi
else
echo -e "Iniciando a instalação do \033[01mWine\033[00m..."
parsebasearch
fi
fi
if hostnamectl | grep $basedebian;
then
if checkWineInstallation; then
wine --version
echo -e "Wine encontrado...ok!"
if checkSicoobnetInstallExists;
then
if ! checkSicoobnetInstallation; then
runSicoobnetInstaller
else
echo -e "\nO \033[01mSicoobnet\033[00m já está instalado.\n"
fi
else
downloadSicoobnetInstall
if checkSicoobnetInstallExists;
then
runSicoobnetInstaller
fi
fi
else
echo -e "Iniciando a instalação do \033[01mWine\033[00m..."
parsebasedebian
fi
fi