#!/bin/bash

################################################################################
#                                                                              #
# cubic                                                                        #
#                                                                              #
# Copyright (C) 2015 PJ Singh <psingh.cubic@gmail.com>                         #
#                                                                              #
################################################################################


################################################################################
#                                                                              #
# This file is part of Cubic - Custom Ubuntu Iso Creator.                      #
#                                                                              #
# Cubic is free software: you can redistribute it and/or modify                #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# Cubic is distributed in the hope that it will be useful,                     #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with Cubic.  If not, see <http://www.gnu.org/licenses/>.               #
#                                                                              #
################################################################################

echo

if [ $(id -u) = 0 ]; then
    echo "Error: Cubic may not be run as a privileged user. Run Cubic using an account with sudo (superuser) membership, and you will be prompted for the superuser password. See \"man cubic\" for more information."
    echo
    exit 1
else
    echo "Cubic (Custom Ubuntu ISO Creator) is a graphical user interface application and should be run using the application launcher. See \"man cubic\" for more information."
    echo
    pkexec /usr/share/cubic/cubic.py "/usr/share/cubic"
fi
