diff --git a/jka-toolkit/apw b/jka-toolkit/apw new file mode 100644 index 0000000..e318f1a --- /dev/null +++ b/jka-toolkit/apw @@ -0,0 +1,138 @@ +#!/bin/bash +# apw, a simple packager wrapper for Arch, Debian, RedHat/Fedora, and Suse (And all his derivates) +# It simplifies the process of remembering pacman,apt, etc , all in one, apw +# Author: JKA Network - contacto@jkanetwork.com + +# $1 is the command +# $2,$3.. will be $packages + +#Knowing the SO with facter +#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 +fi +SO=$(facter osfamily) + + +#Reading packages to install/remove.. (The rest of $) +packages=$2 +for (( i=3; i<=$#; i++ )) +do + valtmp=$(echo $* | cut -f$i -d" ") + packages="$packages $valtmp" +done + +if [[ -z "$1" ]];then +echo "No option especified" +echo "Use apw -h for help" +exit +fi + +if [[ $1 = "-h" || $1 = "-H" ]];then +echo "apw - A Packager Wrapper, a Idea from JKA Network, version 1.0" +echo " Usage: apw