le-dosvox: Add if statement which end the script in case of an error

Signed-off-by: Dalmon Ian Martins de Oliveira <dimo13.c3sl.ufpr.br>
parent 0d937e63
......@@ -29,19 +29,25 @@ function configureDosvox () {
DESKTOP="Área de Trabalho"
sed -e "s/${VAR1}/${VAR2}/" -e "s/${VAR3}/${VAR3}12/" \
-e "s/${VAR4}/${VAR4}29/" \
-i /home/$1/.wine/drive_c/winvox/dosvox.ini
cp "/home/$1/$DESKTOP/Dosvox.desktop" /home/$1
mv "/home/$1/$DESKTOP/Dosvox.lnk" "/home/$1/$DESKTOP/.Dosvox.lnk" &&
sed -i "s\/${1}/\/dosvox_user/\ " /home/$USER_TO_INSTALL/Dosvox.desktop
-i /home/$1/.wine/drive_c/winvox/dosvox.ini ||
cp "/home/$1/$DESKTOP/Dosvox.desktop" /home/$1 ||
mv "/home/$1/$DESKTOP/Dosvox.lnk" "/home/$1/$DESKTOP/.Dosvox.lnk" ||
sed -i "s\/${1}/\/dosvox_user/\ " /home/$USER_TO_INSTALL/Dosvox.desktop ||
cp /home/$1/.wine/drive_c/winvox/dosvox.ini \
/home/$1/.wine/drive_c/windows/dosvox.ini
mkdir $VAR5/Área\ de\ Trabalho
cp /home/$1/Dosvox.desktop "$VAR5/$DESKTOP"
cp -R /home/$1/.wine $VAR5
/home/$1/.wine/drive_c/windows/dosvox.ini ||
mkdir $VAR5/Área\ de\ Trabalho ||
cp /home/$1/Dosvox.desktop "$VAR5/$DESKTOP" ||
cp -R /home/$1/.wine $VAR5 ||
cp/home/$1/.local/share/icons/hicolor/32x32/apps/150E_dosvox.0.png \
$VAR5/.local/share/icons/hicolor/32x32/apps
chown -Rf dosvox_user:dosvox_user $VAR5/.wine
$VAR5/.local/share/icons/hicolor/32x32/apps ||
chown -Rf dosvox_user:dosvox_user $VAR5/.wine ||
chown dosvox_user:dosvox_user "$VAR5/$DESKTOP/Dosvox.desktop"
if [[ "$?" != "0" ]]; then
zenity --error --title="Erro enquanto ao se configurar o dosvox"\
--text="Tente baixar novamente o dosvox"
exit 1
fi
}
# Main
......@@ -85,6 +91,7 @@ if [[ "$EXITCODE" != "0" ]]; then
mais tarde"
exit 1
fi
# Create new user to use dosvox
useradd -m -s /bin/bash dosvox_user
passwd -d dosvox_user
......@@ -98,14 +105,8 @@ do dosvox."
gksudo -u $USER_TO_INSTALL "wine /home/$USER_TO_INSTALL/le-dosvox/dv45-setup.exe"
# Modify some lines on dosvox configuration file
| zenity --progress --pulsate --text="Completando a instalação,\
por favor aguarde" --title="Terminando a instalação"
if [[ "$EXITCODE" != "0" ]]; then
zenity --error --title="Erro enquanto ao se configurar o dosvox"\
--text="Tente baixar novamente o dosvox"
exit 1
fi
configuredosvox $USER_TO_INSTALL | zenity --progress --pulsate \
--text="Completando a instalação, por favor aguarde" --title="Terminando a instalação"
# Displays mensage saying the installation is completed
zenity --info --title="Instalação completa" --text="O Dosvox foi instalado \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment