From d0e8310c940968d599b3a5ed87dea397b4169672 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 2 Nov 2021 12:00:02 +0000 Subject: [PATCH] bin: add scr and https --- .config/shell/functions | 10 +++++++++- .local/bin/scripts/b | 3 ++- .local/bin/scripts/https | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 .local/bin/scripts/https diff --git a/.config/shell/functions b/.config/shell/functions index 47523f1..7ac227f 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -130,7 +130,15 @@ alias scu='systemctl --user' alias scue='systemctl --user enable --now' alias scud='systemctl --user disable --now' -# Restart matching systemctl service +# Reload or restart matching systemctl service +scr() { + systemctl --user reload "$1" || + sudo systemctl reload "$1" || + systemctl --user restart "$1" || + sudo systemctl restart"$1" || +} + +# Restart matching systemctl service with chance for input inbetween scb() { systemctl --user stop -T "$1" sudo systemctl stop -T "$1" diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index ab413f3..4c3e716 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -2,9 +2,10 @@ # [b]rowse - custom ls or bat depending on file type # Show type & contents of given files or PWD # depends: tput stat bat neovim +# args: files to inspect set -eo pipefail -# gets the last arg or current dir +# get the last arg or current dir for last; do true; done last=${last:-.} diff --git a/.local/bin/scripts/https b/.local/bin/scripts/https new file mode 100755 index 0000000..5e371c6 --- /dev/null +++ b/.local/bin/scripts/https @@ -0,0 +1,6 @@ +#!/bin/sh +# Setup certbot certificate for nginx +# args: +# 1) domain +# 2) email +sudo certbot -v -n certonly --nginx -m ${2:-$(git config --get user.email)} --agree-tos -d $1