mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-02-15 09:31:32 +01:00
Merge branch 'development'
This commit is contained in:
31
jka-toolkit/addit
Executable file
31
jka-toolkit/addit
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# addit, A script to manage files with dialog
|
||||
# Author: JKA Network - contacto@jkanetwork.com
|
||||
|
||||
VERSION="0.1.0"
|
||||
options=`dialog --stdout --menu "addit - version: $version" 0 0 6 a "Manage permanent alias"`
|
||||
|
||||
case $options in
|
||||
"a" )
|
||||
reop=`dialog --stdout --menu "Select option" 0 0 6 0 "Add alias" 1 "Remove alias"`
|
||||
case $reop in
|
||||
0)
|
||||
if [ -z "$(grep -o "if \[ -f ~/.bash_aliases \]; then" $HOME/.bashrc )" ];then
|
||||
echo "ADD BY ADDIT - PERMIT USE ALIAS" >> $HOME/.bashrc
|
||||
echo "if [ -f ~/.bash_aliases ]; then" >> $HOME/.bashrc
|
||||
echo " . ~/.bash_aliases" >> $HOME/.bashrc
|
||||
echo "fi" >> $HOME/.bashrc
|
||||
fi
|
||||
ali=`dialog --stdout --inputbox "Alias name to add" 0 60`
|
||||
comand=`dialog --stdout --inputbox "Command" 0 60`
|
||||
echo "alias $ali='$comand'" >> $HOME/.bash_aliases
|
||||
echo "Restart $(tty)"
|
||||
;;
|
||||
1)
|
||||
ali=`dialog --stdout --inputbox "Alias name to remove" 0 60`
|
||||
sed -i '/$ali/d' $HOME/bash_aliases
|
||||
echo "Restart $(tty)"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -2,7 +2,7 @@
|
||||
# gitdit, a dialog interface to manage git repositories
|
||||
# Author: JKA Network - contacto@jkanetwork.com
|
||||
|
||||
VERSION="1.0.0"
|
||||
VERSION="1.0.1"
|
||||
#First check if the user is in a git repository
|
||||
preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ")
|
||||
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
|
||||
@@ -47,8 +47,8 @@ if [ ! -z $gitopt ];then #No canceled
|
||||
"p")
|
||||
git pull $actual;;
|
||||
"s")
|
||||
estado=$(git status | grep -o "^Changes" ) #It need to commit something?
|
||||
if [ $estado ];then #When is necesary commit
|
||||
estado=$(git status | grep -oE "^Changes|^Untracked" ) #It need to commit something?
|
||||
if [ "$estado" ];then #When is necesary commit
|
||||
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
commit="changes"
|
||||
@@ -84,7 +84,7 @@ if [ ! -z $gitopt ];then #No canceled
|
||||
error=0 #If 1 aux is yet in lista array
|
||||
for (( i=0;i<${#lista[@]} && error==0;i++ ))
|
||||
do
|
||||
if [ $aux =s ${lista[$i]} -o $aux = $actual2 ];then
|
||||
if [ $aux == ${lista[$i]} -o $aux = $actual2 ];then
|
||||
error=1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#JKA - ZIP
|
||||
#A script for de/compress files and folders in many formats
|
||||
#Author: JKA Network - contacto@jkanetwork.com
|
||||
#Function decompress(); decompress the file whith the format especified
|
||||
|
||||
# gettext initialization
|
||||
export TEXTDOMAIN='jkazip'
|
||||
@@ -40,7 +39,7 @@ function msg2() {
|
||||
echo
|
||||
}
|
||||
|
||||
version="2.0.3"
|
||||
version="2.3.0"
|
||||
if [ -z "$1" ];then
|
||||
echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr
|
||||
elif [ "$1" = "-h" ];then
|
||||
@@ -48,6 +47,7 @@ elif [ "$1" = "-h" ];then
|
||||
echo ""
|
||||
echo "$(gettext " -d, decompress file")"
|
||||
echo "$(gettext " -c <output file>, compress file")"
|
||||
echo "$(gettext " -l, list all files")"
|
||||
echo "$(gettext " -h, show help box and exit")"
|
||||
echo "$(gettext " -v, show version and exit")"
|
||||
echo ""
|
||||
@@ -178,6 +178,39 @@ elif [ "$1" = "-c" ];then
|
||||
echo > /dev/stderr
|
||||
;;
|
||||
esac
|
||||
elif [ "$1" = "-l" ];then
|
||||
if [ -z "$2" ];then
|
||||
echo "$(gettext "No file or directory specified")" > /dev/stderr
|
||||
exit
|
||||
fi
|
||||
sacaFormato $2
|
||||
case $formato in
|
||||
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz2" | "txz" | "tlz")
|
||||
tar taf "$2"
|
||||
;;
|
||||
"7z")
|
||||
7z l "$2"
|
||||
;;
|
||||
"zip")
|
||||
unzip -v "$2"
|
||||
;;
|
||||
"gz" )
|
||||
gzip -l "$2"
|
||||
;;
|
||||
"xz")
|
||||
xz -l "$2"
|
||||
;;
|
||||
"bz2" | "lz" )
|
||||
echo "Not supported for listing" > /dev/stderr
|
||||
;;
|
||||
"rar")
|
||||
unrar v "$2"
|
||||
;;
|
||||
*)
|
||||
printf -- "$(gettext "File extension %s are not supported")" $formato > /dev/stderr
|
||||
echo > /dev/stderr
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "$(gettext "Unknown option")" > /dev/stderr
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user