Compare commits

..

7 Commits

Author SHA1 Message Date
PorridgePi
88176cdd3e zshrc: fix: Use ll for llt 2022-09-29 05:03:40 +01:00
PorridgePi
f68dfd8738 zshrc: feat: Add $HOME/bin/external to $PATH 2022-09-29 05:03:20 +01:00
PorridgePi
6298992676 bootstrap: librespeed-cli: Initial commit 2022-09-29 05:02:22 +01:00
PorridgePi
794f14dfcf scripts: README: feat: Add wireguard-install 2022-09-29 04:42:11 +01:00
PorridgePi
e70c613cea scripts: README: feat: Use external scripts directory 2022-09-29 04:36:32 +01:00
PorridgePi
223ee6c8c9 scripts: feat: Add directory for external scripts 2022-09-29 04:35:44 +01:00
PorridgePi
45233069f2 scripts: README: Add docker-install 2022-09-29 04:28:45 +01:00
4 changed files with 61 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
if ! command -v librespeed-cli &> /dev/null; then
echo 'Installing librespeed-cli'
source $HOME/.zshenv
if [[ "$OSNAME" == "Linux" ]]; then
# Linux
if [[ "$DISTRO_TYPE" == "debian" ]]; then
# Debian-based
if [[ "$ARCH" == "aarch64" ]]; then
ARCH=arm64
fi
URL=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest-cli/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep linux | grep $ARCH)
mkdir -p $HOME/.temp/librespeed
curl -fsSL -o $HOME/.temp/librespeed/librespeed.tar.gz "$URL"
tar -xzf $HOME/.temp/librespeed/librespeed.tar.gz -C $HOME/.temp/librespeed/
cp $HOME/.temp/librespeed/librespeed-cli $HOME/bin/external/
rm -r $HOME/.temp/librespeed/
else
# Unknown distro
echo 'ERROR: Unknown distro'
echo 'Exiting...'
exit 1
fi
elif [[ "$OSNAME" == "macOS" ]]; then
# macOS
exit 1
else
# Unknown
echo 'ERROR: Unknown OS'
echo 'Exiting...'
exit 1
fi
fi
echo 'librespeed-cli is installed'

4
.zshrc
View File

@@ -52,7 +52,7 @@ fi
########## Personal ###########################################################
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/bin:$HOME/bin/external:$PATH"
export TERM=xterm-256color
eval $(thefuck --alias)
@@ -66,7 +66,7 @@ alias la='lsd --color auto -A'
alias ll='lsd --color auto -laF'
function lst { ls --tree --depth ${1:-2} }
function lat { la --tree --depth ${1:-2} }
function llt { la --tree --depth ${1:-2} }
function llt { ll --tree --depth ${1:-2} }
# Docker Compose
alias dc='docker-compose'

17
bin/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Scripts
## External scripts
### [docker-install](https://github.com/docker/docker-install)
```sh
curl -fsSL https://get.docker.com -o $HOME/bin/external/get-docker.sh
sh get-docker.sh
```
### [wireguard-install](https://github.com/Nyr/wireguard-install)
```sh
curl -fsSL https://git.io/wireguard -o $HOME/bin/external/wireguard-install.sh
bash $HOME/bin/external/wireguard-install.sh
```

6
bin/external/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
# Ignore everything in this directory
*
# except for
!.gitignore
!README.md