diff options
-rwxr-xr-x | sisyphus-gui | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sisyphus-gui b/sisyphus-gui index 87254ec..0d46356 100755 --- a/sisyphus-gui +++ b/sisyphus-gui @@ -1,12 +1,29 @@ #!/usr/bin/env bash -# Sisyphus is a simple GUI for sisyphus, the portage wrapper +# Sisyphus-GUI is a simple frontend for libsisyphus # Main Author : Ghiunhan Mamut @ Redcore Linux Project +if [[ -f /lib/gentoo/functions.sh ]] ; then + source /lib/gentoo/functions.sh +else + echo "Cannot import Gentoo functions, I will abort now!" + exit 1 +fi + +checkifroot() { + if [[ "$(whoami)" != root ]] ; then + eerror "I won't do that, unless you're root!" + exit 1 + fi +} + + main() { - pushd /usr/share/sisyphus - python3 sisyphus-gui.py - popd + if checkifroot; then + pushd /usr/share/sisyphus + python3 sisyphus-gui.py + popd + fi } main |