diff --git a/jka-toolkit.tar.gz b/jka-toolkit.tar.gz index 2912d53..b8e913a 100644 Binary files a/jka-toolkit.tar.gz and b/jka-toolkit.tar.gz differ diff --git a/jka-toolkit/apw b/jka-toolkit/apw index a8b0253..1861ead 100755 --- a/jka-toolkit/apw +++ b/jka-toolkit/apw @@ -1,17 +1,52 @@ #!/bin/bash -# apw, a simple packager wrapper for Arch, Debian, RedHat/Fedora, and Suse (And all his derivates) +# apw, a simple packager wrapper for Arch, Debian, RedHat/Fedora, CentOS 6, Suse, and all his derivates) # It simplifies the process of remembering pacman,apt,dnf, etc , all in one called apw # Author: JKA Network - contacto@jkanetwork.com # $1 is the command # $2,$3.. will be $packages -#If facter is not installed.. -if [[ ! -f /usr/bin/facter ]];then - echo "apw can not run without facter. Please install facter, is a dependency of apw" - exit +#Force sudo +uid=$(/usr/bin/id -u) +if [[ $uid != "0" ]];then +echo "apw has to run as root, please run as root/with sudo" +exit fi +if [[ ! -f /etc/apw.conf ]];then + echo "It's the first run of the program, we need a thing before continue" + echo "What, or in what is based your Linux?" + echo "(The answer will be recorded in /etc/apw.conf, if you want to reset apw, delete this file)" + options=("Debian/Ubuntu (apt)" "Fedora/Redhat (dnf)" "CentOS 6 (yum)" "Archlinux (pacman)" "Suse (zypper)") + select opt in "${options[@]}" + do + case $opt in + "Debian/Ubuntu (apt)") + echo "apt" > /etc/apw.conf + break + ;; + "Fedora/Redhat (dnf)") + echo "dnf" > /etc/apw.conf + break + ;; + "CentOS 6 (yum)") + echo "yum" > /etc/apw.conf + break + ;; + "Archlinux (pacman)") + echo "pacman" > /etc/apw.conf + break + ;; + "Suse (zypper)") + echo "zypper" > /etc/apw.conf + break + ;; + esac + done +fi + +SO=$(cat /etc/apw.conf) + #This option is for make if case insensitive shopt -s nocasematch @@ -26,7 +61,7 @@ done #echo for every option case "$1" in *h*) - echo "apw - A Packager Wrapper, a Idea from JKA Network, version 1.2" + echo "apw - A Packager Wrapper, a Idea from JKA Network, version 1.3" echo " Usage: apw