Use unp instead of custom extract script

This commit is contained in:
2025-05-22 23:26:35 +01:00
parent ed2cef757c
commit 83bf4a7ec8
3 changed files with 2 additions and 58 deletions

View File

@@ -22,6 +22,7 @@ alias t='tmux'
alias v='nvim' alias v='nvim'
alias t='tmux' alias t='tmux'
alias raid='sudo mdadm --detail /dev/md0' alias raid='sudo mdadm --detail /dev/md0'
alias unp='unp -U' # Extract any file type
if command -v batcat 2>&1 >/dev/null; then if command -v batcat 2>&1 >/dev/null; then
alias bat=batcat alias bat=batcat

View File

@@ -80,7 +80,7 @@ echo
# Install Programs # Install Programs
if [ "$reload" = false ]; then if [ "$reload" = false ]; then
sudo apt install curl git tmux fzf tealdeer pass-otp zbar-tools lynis bat ufw \ sudo apt install curl git tmux fzf tealdeer pass-otp zbar-tools lynis bat ufw unp \
gir1.2-gtop-2.0 lm-sensors # Vitals Extension deps gir1.2-gtop-2.0 lm-sensors # Vitals Extension deps
fi fi

View File

@@ -1,57 +0,0 @@
#! /bin/sh
extract() {
if [ -f "$1" ]; then
case "$1" in
*.tar.bz2)
command -v tar >/dev/null || sudo apt install -y tar
tar xjvf "$1"
;;
*.tar.gz)
command -v tar >/dev/null || sudo apt install -y tar
tar xzvf "$1"
;;
*.bz2)
command -v bunzip2 >/dev/null || sudo apt install -y bzip2
bunzip2 "$1"
;;
*.rar)
command -v unrar >/dev/null || sudo apt install -y unrar
unrar e "$1"
;;
*.gz)
command -v gunzip >/dev/null || sudo apt install -y gzip
gunzip "$1"
;;
*.tar)
command -v tar >/dev/null || sudo apt install -y tar
tar xf "$1"
;;
*.tbz2)
command -v tar >/dev/null || sudo apt install -y tar
tar xjf "$1"
;;
*.tgz)
command -v tar >/dev/null || sudo apt install -y tar
tar xzf "$1"
;;
*.zip)
command -v unzip >/dev/null || sudo apt install -y unzip
unzip "$1"
;;
*.Z)
command -v uncompress >/dev/null || sudo apt install -y ncompress
uncompress "$1"
;;
*.7z)
command -v 7z >/dev/null || sudo apt install -y p7zip
7z x "$1"
;;
*)
echo "'$1' cannot be extracted via extract()"
;;
esac
else
echo "'$1' is not a valid file"
fi
}