123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #!/bin/bash
- if [ "$(whoami)" != "root" ]; then
- echo "You need to be in root privileges to run this script. Exiting."
- exit 1
- fi
- WORKDIR=$(pwd)
- install(){
- echo "Installing Dependencies"
- apt install gir1.2-ayatanaappindicator3-0.1 libayatana-appindicator3-1 gir1.2-gtk-3.0 zenity python3-gi python3-tk synaptic libnotify-bin
- if [ ! -d "/usr/lib/urukUpdater" ]; then
- mkdir /usr/lib/urukUpdater;
- cp ${WORKDIR}/usr/lib/urukUpdater/* /usr/lib/urukUpdater;
- else
- rm -rf /usr/lib/urukUpdater/*
- cp ${WORKDIR}/usr/lib/urukUpdater/* /usr/lib/urukUpdater;
- fi
-
- if [ ! -d "/usr/share/urukUpdater" ]; then
- mkdir /usr/share/urukUpdater;
- cp -r ${WORKDIR}/usr/share/urukUpdater/* /usr/share/urukUpdater;
- else
- rm -rf /usr/share/urukUpdater/*;
- cp -r ${WORKDIR}/usr/share/urukUpdater/* /usr/share/urukUpdater;
- fi
-
- if [ ! -f "/usr/share/applications/urukupdater.desktop" ]; then
- cp ${WORKDIR}/urukupdater.desktop /usr/share/applications;
- else
- cp --force ${WORKDIR}/urukupdater.desktop /usr/share/applications;
- fi
- if [ ! -f "/usr/share/pixmaps/urukupdater.svg" ]; then
- cp ${WORKDIR}//usr/share/pixmaps/urukupdater.svg /usr/share/pixmaps/;
- else
- cp --force ${WORKDIR}//usr/share/pixmaps/urukupdater.svg /usr/share/pixmaps/;
- fi
-
- if [ ! -f "/usr/bin/urukupdater" ]; then
- cp ${WORKDIR}/usr/bin/urukupdater /usr/bin/;
- else
- cp --force ${WORKDIR}/usr/bin/urukupdater /usr/bin/;
- fi
- if [ ! -f "/etc/sudoers.d/urukupdater" ]; then
- cp ${WORKDIR}/etc/sudoers.d/urukupdater /etc/sudoers.d/;
- else
- cp --force ${WORKDIR}/etc/sudoers.d/urukupdater /etc/sudoers.d/;
- fi
- if [ ! -f "/etc/xdg/autostart/urukupdater.desktop" ]; then
- cp ${WORKDIR}/etc/xdg/autostart/urukupdater.desktop /etc/xdg/autostart;
- else
- cp --force ${WORKDIR}/etc/xdg/autostart/urukupdater.desktop /etc/xdg/autostart;
- fi
- chmod +x /usr/bin/urukupdater
- chmod +x /usr/share/urukUpdater/*.py
- chmod +x /usr/share/urukUpdater/updater-status
- chmod +x /usr/lib/urukUpdater/*
- chmod +x /etc/sudoers.d/urukupdater
- }
- uninstall(){
- if [ -d "/usr/lib/urukUpdater" ]; then
- rm -rf /usr/lib/urukUpdater;
- fi
-
- if [ -d "/usr/share/urukUpdater" ]; then
- rm -rf /usr/share/urukUpdater;
- fi
-
- if [ -f "/usr/share/applications/urukupdater.desktop" ]; then
- rm -rf /usr/share/applications/urukupdater.desktop;
- fi
- if [ -f "/usr/share/pixmaps/urukupdater.svg" ]; then
- rm -rf /usr/share/pixmaps/urukupdater.svg;
- fi
-
- if [ -f "/usr/bin/urukupdater" ]; then
- rm -rf /usr/bin/urukupdater;
- fi
- if [ -f "/etc/sudoers.d/urukupdater" ]; then
- rm -rf /etc/sudoers.d/urukupdater;
- fi
- if [ -f "/etc/xdg/autostart/urukupdater.desktop" ]; then
- rm -rf /etc/xdg/autostart/urukupdater.desktop;
- fi
- }
-
-
-
- if [ "$1" = "help" ]; then
- echo " This script will help you to install or uninstall for Uruk Updater"
- echo " "
- echo " Usage this script as follows:"
- echo " "
-
- echo " sudo ./installer help|install|uninstall"
- echo " "
- echo " "
- echo " Examples:"
- echo " "
- echo " "
- echo " sudo ./installer install ==> (to install urukupdater on your system)"
- echo " "
- echo " sudo ./installer uninstall ==> (to remove uninstall urukupdater from your system)"
-
-
- echo " "
- echo " sudo ./installer help ==> (to show this help instructions )"
- echo " "
- echo " for more information, you can see to official page:"
- echo " https://www.notabug.org/hayderctee/urukupdater"
- echo " "
- elif [ "$1" = "" ]; then
- echo " you need to use one argument to use this script"
- echo " "
- echo " Usage of installer script is as follows:"
- echo " "
- echo " sudo ./installer install ==> (to install urukupdater on your system)"
- echo " "
- echo " sudo ./installer uninstall ==> (to remove uninstall urukupdater from your system)"
- echo " "
-
- echo " "
- echo " sudo ./installer help ===> for more info"
- elif [ "$1" = "install" ]; then
- echo "installing Uruk Updater . . ."
- install
- echo "done"
- elif [ "$1" = "uninstall" ]; then
- echo "uninstalling Uruk Updater . . ."
- echo ""
- uninstall
- echo "done"
-
-
-
- else
- echo "Use valid input command . . ."
- echo " you need to use one argument to use this script"
- echo " "
- echo " Usage of installer script is as follows:"
- echo " "
- echo " sudo ./installer install ==> (to install urukupdater on your system)"
- echo " "
- echo " sudo ./installer uninstall ==> (to remove uninstall urukupdater from your system)"
- echo " "
-
- echo " "
- echo " sudo ./installer help ===> for more info"
- fi
|