2024-09-30 21:52:15 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2024-10-31 19:07:20 +00:00
|
|
|
. ../../common-script.sh
|
2024-09-30 21:52:15 +01:00
|
|
|
|
|
|
|
installLibreOffice() {
|
2024-11-01 17:25:11 +00:00
|
|
|
if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then
|
2024-09-30 21:52:15 +01:00
|
|
|
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
|
|
|
|
case "$PACKAGER" in
|
|
|
|
apt-get|nala)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
|
|
|
|
;;
|
|
|
|
zypper|dnf)
|
2024-11-01 17:25:11 +00:00
|
|
|
checkFlatpak
|
2024-09-30 21:52:15 +01:00
|
|
|
flatpak install -y flathub org.libreoffice.LibreOffice
|
|
|
|
;;
|
|
|
|
pacman)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
|
|
|
;;
|
2024-11-07 19:03:21 +00:00
|
|
|
apk)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" add libreoffice
|
|
|
|
;;
|
2024-09-30 21:52:15 +01:00
|
|
|
*)
|
|
|
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
printf "%b\n" "${GREEN}Libre Office is already installed.${RC}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
|
|
|
checkEscalationTool
|
|
|
|
installLibreOffice
|