bin: function adjustments

This commit is contained in:
xeruf 2022-10-31 17:44:15 +01:00
parent 8f4fda1a1f
commit c825980c29
3 changed files with 3 additions and 1 deletions

View File

@ -245,7 +245,7 @@ del() {
u() { u() {
# Line below handy for users of netkeeper # Line below handy for users of netkeeper
ping example.com -c 1 -w 2 >/dev/null && sudo nft list ruleset | grep -1 outall | grep -q 'meta hour' || echo sysupgrade | netkeeper 30 2>/dev/null timeout 1 curl -s https://github.com >/dev/null || echo "Suspending netkeeper" >&2 | echo sysupgrade | netkeeper 30 2>/dev/null
if command -v pacman >/dev/null; then if command -v pacman >/dev/null; then
if test "$(stat /etc/pacman.d/mirrorlist --printf=%y | cut -d'-' -f1-2)" != "$(date +%Y-%m)" if test "$(stat /etc/pacman.d/mirrorlist --printf=%y | cut -d'-' -f1-2)" != "$(date +%Y-%m)"
then then

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# Clean up files according to given parameters # Clean up files according to given parameters
# TODO filter recently accessed files
typeset -A _clean_map typeset -A _clean_map
_clean_map=([h]=$XDG_CACHE_HOME [t]=/var/tmp [l]=/var/log [v]=/var/cache) _clean_map=([h]=$XDG_CACHE_HOME [t]=/var/tmp [l]=/var/log [v]=/var/cache)

View File

@ -34,6 +34,7 @@ case "$sel" in
(/etc/ssh/*) sudoedit "$sel" && sudo systemctl reload-or-restart sshd;; (/etc/ssh/*) sudoedit "$sel" && sudo systemctl reload-or-restart sshd;;
(/etc/network/interfaces*) sudoedit "$sel" && sudo service networking reload;; (/etc/network/interfaces*) sudoedit "$sel" && sudo service networking reload;;
(/etc/samba/smb.conf) sudoedit "$sel" && testparm;; (/etc/samba/smb.conf) sudoedit "$sel" && testparm;;
(/etc/nftables.conf) sudoedit "$sel" && sudo systemctl restart nftables;;
(*) edit "$sel";; (*) edit "$sel";;
esac esac
echo "$sel" | cat - "$conf_cache" | head -20 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache" echo "$sel" | cat - "$conf_cache" | head -20 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache"