Commit fbfcd6a9 authored by Bady's avatar Bady

0th commit

parents
This diff is collapsed.
# Omega Installer
Omega installer is a third-party package manager used to install and update custom packages that cannot (or not recommended to) be updated via the default package manager.
## Dependencies
* [Zenity](https://wiki.gnome.org/Projects/Zenity)
## Configuration
Address of the server from which the packages to be downloaded can be configured in the config.ini file
## License
This application is released under GPL v3.
## Logo credits
Mujeeb Rahman K (mujeebcpy at disroot dot org)
## Contact
[Alpha Fork Technologies](https://alphafork.com)
Email: connect at alphafork dot com
\ No newline at end of file
[Server]
; domain name or ip address of server from which packages to be downloaded
SERVER=https://example.com/omega-installer
\ No newline at end of file
#! /bin/bash
cp omega-installer /usr/local/bin
chmod 755 /usr/local/bin/omega-installer
if [ ! -d "/usr/local/share/omega-installer" ]; then
mkdir /usr/local/share/omega-installer
fi
cp config.ini /usr/local/share/omega-installer/
cp logo.png /usr/local/share/omega-installer/
cp omega-installer.desktop /usr/local/share/applications/
update-desktop-database /usr/local/share/applications
\ No newline at end of file
logo.png

26 KB

#! /bin/bash
# Read server address from config file
source <(grep = /usr/local/share/omega-installer/config.ini)
# Start main window showing the list of applications to install/update
PKGS="$(zenity --list \
--title="Packages availbale for installation/update" \
--width=400 \
--height=400 \
--checklist \
--ok-label="Update" \
--cancel-label="Exit" \
--column=Select --column=Package \
FALSE "Image and PDF Actions Menu" \
TRUE "Janayugom Edit" \
TRUE "Malayalam Fonts" \
FALSE "Malayalam Keyboard" \
TRUE "Omega Installer" \
TRUE "Scribus SVN" \
FALSE "Scribus Templates")"
# Exit if no packages selected or pressed cancel button
[[ "$PKGS" ]] || exit 1
# Ask for sudo password
PASSWD="$(zenity --password --title="Sudo password prompt" --timeout=10)\n"
{
echo 30
sleep 1
echo 60
sleep 1
echo 90
sleep 1
} |
zenity --progress \
--title="Authentication" \
--text="Waiting for user authentication..." \
--width=300 \
--height=100 \
--percentage=0 \
--timeout=4 &
if ! echo -e $PASSWD | su $USER; then
zenity --error \
--width=300 \
--height=100 \
--text="Incorrect password or insufficient permission"
exit 1
fi
# Check for network connectivity
FQDN=`echo $SERVER | cut -d'/' -f3 | cut -d':' -f1`
if ! ping -q -c 1 -W 1 $FQDN >/dev/null; then
zenity --error \
--width=300 \
--height=100 \
--text="Please check your internet connection and try again."
exit 1
fi
errors=0
omega_update() {
cd /tmp
wget -O "${1}.tar.gz" "${SERVER}/${1}.tar.gz"
if [[ $? -ne 0 ]]; then
let errors++
return 1
fi
if [[ -d "/tmp/${1}" ]]; then
echo -e $PASSWD | sudo -S rm -rf "/tmp/${1}"
fi
tar -xvzf "${1}.tar.gz"
return 0
}
# Update/install packages
{
if [[ "$PKGS" =~ "Image and PDF Actions Menu" ]]; then
echo "5"
echo "# Updating Image and PDF Actions Menu"
omega_update kde-service-menu
if [[ $? -eq 0 ]]; then
cd kde-service-menu/reimage-menu
bash uninstall.sh
echo -e $PASSWD | sudo -S bash uninstall.sh
echo -e $PASSWD | sudo -S bash install.sh
[[ $? -ne 0 ]] || let errors++
cd ../pdf-menu
echo -e $PASSWD | sudo -S gdebi -n kde-service-menu-pdf.deb
[[ $? -ne 0 ]] || let errors++
fi
fi
if [[ "$PKGS" =~ "Janayugom Edit" ]]; then
echo "10"
echo "# Updating Janayugom Edit"
omega_update janayugom-edit
if [[ $? -eq 0 ]]; then
echo -e $PASSWD | sudo -S cp -r janayugom-edit/* /usr
echo -e $PASSWD | sudo -S chmod 755 /usr/bin/janayugomedit
echo -e $PASSWD | sudo -S update-desktop-database /usr/share/applications
fi
fi
if [[ "$PKGS" =~ "Malayalam Keyboard" ]]; then
echo "35"
echo "# Updating Malayalam Keyboard"
omega_update keyboards
if [[ $? -eq 0 ]]; then
echo -e $PASSWD | sudo -S cp keyboards/*.mim /usr/share/m17n
fi
fi
if [[ "$PKGS" =~ "Malayalam Fonts" ]]; then
echo "40"
echo "# Updating Malayalam Fonts"
omega_update fonts
if [[ $? -eq 0 ]]; then
echo -e $PASSWD | sudo -S cp fonts/* /usr/share/fonts/
fc-cache -fv
fi
fi
if [[ "$PKGS" =~ "Omega Installer" ]]; then
echo "45"
echo "# Updating Omega Installer"
omega_update omega-installer
if [[ $? -eq 0 ]]; then
cd omega-installer
echo -e $PASSWD | sudo -S bash install.sh
[[ $? -ne 0 ]] || let errors++
fi
fi
if [[ "$PKGS" =~ "Scribus SVN" ]]; then
echo "60"
echo "# Updating Scribus SVN"
omega_update scribus-svn
if [[ $? -eq 0 ]]; then
cd scribus-svn
echo -e $PASSWD | sudo -S gdebi -n scribus-trunk-data.deb && echo -e $PASSWD | sudo -S gdebi -n scribus-trunk.deb
[[ $? -ne 0 ]] || let errors++
fi
fi
if [[ "$PKGS" =~ "Scribus Templates" ]]; then
echo "90"
echo "# Updating Scribus Templates"
omega_update scribus-templates
if [[ $? -eq 0 ]]; then
echo -e $PASSWD | sudo -S rm -rf ~/Templates/{"Obit","obit","P 2","P 3"}
cp -r scribus-templates/* ~/Templates/
fi
fi
echo "100"
echo "# Completed"
} |
zenity --progress \
--title="Update in progress" \
--text="Updating packages..." \
--width=300 \
--height=100 \
--percentage=0
if [[ $? = -1 ]]; then
zenity --error \
--width=300 \
--height=100 \
--text="Update cancelled"
fi
if [[ $errors > 0 ]]; then
zenity --error \
--width=300 \
--height=100 \
--text="Some errors occured during installion. Please try again"
exit 1
else
exit 0
fi
\ No newline at end of file
[Desktop Entry]
Type=Application
Name=Omega Installer
Comment=Custom package installer and updater
GenericName=Install and update packages
TryExec=/usr/local/bin/omega-installer
Exec=/usr/local/bin/omega-installer
Icon=/usr/local/share/omega-installer/logo.png
Terminal=false
Categories=System;Utilities
\ No newline at end of file
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