mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-03-02 00:43:47 +01:00
apw 1.2
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/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, and Suse (And all his derivates)
|
||||||
# It simplifies the process of remembering pacman,apt, etc , all in one, apw
|
# It simplifies the process of remembering pacman,apt,dnf, etc , all in one called apw
|
||||||
# Author: JKA Network - contacto@jkanetwork.com
|
# Author: JKA Network - contacto@jkanetwork.com
|
||||||
|
|
||||||
# $1 is the command
|
# $1 is the command
|
||||||
@@ -18,14 +18,14 @@ shopt -s nocasematch
|
|||||||
#echo for every option
|
#echo for every option
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*h*)
|
*h*)
|
||||||
echo "apw - A Packager Wrapper, a Idea from JKA Network, version 1.1"
|
echo "apw - A Packager Wrapper, a Idea from JKA Network, version 1.2"
|
||||||
echo " Usage: apw <option> [packages]"
|
echo " Usage: apw <option> [packages]"
|
||||||
echo " {-h | h} This help"
|
echo " {-h | h} Show this help"
|
||||||
echo " {-U | U} Update system"
|
echo " {-U | U} Update system"
|
||||||
echo " {-I | I} Install packages (Updates system also for preventing problems"
|
echo " {-I | I} Install packages (Updates system also for preventing problems"
|
||||||
echo " {-R | R} Removes a package"
|
echo " {-R | R} Removes a package"
|
||||||
echo " {-S | S} Search in package database"
|
echo " {-S | S} Search in package database"
|
||||||
echo " {-F | F} Install file (distro family dependent, ej .deb , .pkg.tar.xz,...)"
|
echo " {-F | F} Install file (distro family dependent, e.g. .deb , .pkg.tar.xz,...)"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
*U*)
|
*U*)
|
||||||
@@ -50,6 +50,14 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
#Obligar sudo antes de hacer operaciones que puedan requerirlo
|
||||||
|
uid=$(/usr/bin/id -u)
|
||||||
|
if [[ $uid != "0" ]];then
|
||||||
|
echo "apw has to run as root, please run as root/with sudo"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
#Knowing the SO with facter
|
#Knowing the SO with facter
|
||||||
SO=$(facter osfamily)
|
SO=$(facter osfamily)
|
||||||
|
|
||||||
@@ -61,13 +69,6 @@ do
|
|||||||
packages="$packages $valtmp"
|
packages="$packages $valtmp"
|
||||||
done
|
done
|
||||||
|
|
||||||
#Obligar 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
|
|
||||||
|
|
||||||
#Check if is dnf in RedHat, or apt in Debian, new tools
|
#Check if is dnf in RedHat, or apt in Debian, new tools
|
||||||
if [[ $SO = "RedHat" && ! -f /usr/bin/dnf ]];then
|
if [[ $SO = "RedHat" && ! -f /usr/bin/dnf ]];then
|
||||||
yum install dnf
|
yum install dnf
|
||||||
|
|||||||
Reference in New Issue
Block a user