forked from cowboy/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path50_system.sh
More file actions
executable file
·37 lines (34 loc) · 1012 Bytes
/
50_system.sh
File metadata and controls
executable file
·37 lines (34 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Package management
if is_osx; then
alias update="brew -qq update && brew upgrade"
alias install="brew install"
alias remove="brew remove"
alias search="brew search"
elif is_debian; then
alias update="sudo apt -qq update && sudo apt upgrade"
alias install="sudo apt install"
alias remove="sudo apt remove"
alias search="apt search"
elif is_archlinux; then
alias update="sudo pacman -qq update && sudo pacman upgrade"
alias install="sudo pacman install"
alias remove="sudo pacman remove"
alias search="pacman -Q"
elif is_linux; then
alias update="sudo yum -qq update && sudo yum upgrade"
alias install="sudo yum install"
alias remove="sudo yum remove"
alias search="yum -C search"
fi
# Make 'less' more.
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
ipif() {
if grep -P "(([1-9]\d{0,2})\.){3}(?2)" <<< "$1"; then
curl ipinfo.io/"$1"
else
ipawk=($(host "$1" | awk '/address/ { print $NF }'))
curl ipinfo.io/${ipawk[1]}
fi
echo
}
alias e="exit"