Compare commits
7 Commits
43cca1cb99
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b13b9f7fc5 | |||
| c786299e91 | |||
| d9b6d6b3c5 | |||
| 7a23304c9c | |||
| eeecf8df23 | |||
| 5f289995ba | |||
| 5542e2ab9a |
2
aping.sh
2
aping.sh
@@ -87,7 +87,7 @@ withoutLoop(){
|
|||||||
elif [ $? = "1" ];then
|
elif [ $? = "1" ];then
|
||||||
|
|
||||||
if [ "${play_sound}" = "true" ];then
|
if [ "${play_sound}" = "true" ];then
|
||||||
${sound_player} ${player_opts} ${sound_file} "${sound_message}" &
|
${sound_player} "${player_opts}" "${sound_file}" "${sound_message}" &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
114
dns-rescue.sh
Executable file
114
dns-rescue.sh
Executable file
@@ -0,0 +1,114 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# dns-rescue.sh — emergency DNS recovery on a machine where AdGuard Home is the
|
||||||
|
# sole local resolver (systemd-resolved is masked). If AGH fails to start, this
|
||||||
|
# machine has no DNS until you intervene. Run this script from a TTY login.
|
||||||
|
#
|
||||||
|
# Author: Justin Moore
|
||||||
|
# Version: 0.1.0
|
||||||
|
|
||||||
|
set -u
|
||||||
|
|
||||||
|
RESOLV=/etc/resolv.conf
|
||||||
|
FALLBACK=1.1.1.1
|
||||||
|
|
||||||
|
require_root() {
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
echo "Re-running with sudo..."
|
||||||
|
exec sudo -E "$0" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
show_status() {
|
||||||
|
echo "=== /etc/resolv.conf ==="
|
||||||
|
cat "$RESOLV" 2>/dev/null || echo "(missing!)"
|
||||||
|
echo
|
||||||
|
echo "=== AdGuard Home service ==="
|
||||||
|
systemctl is-active adguardhome 2>&1 | head -1
|
||||||
|
systemctl is-enabled adguardhome 2>&1 | head -1
|
||||||
|
echo
|
||||||
|
echo "=== Last 15 AGH log lines (this boot) ==="
|
||||||
|
journalctl -u adguardhome -b --no-pager -n 15 2>&1 | tail -15
|
||||||
|
echo
|
||||||
|
echo "=== Port 53 listeners ==="
|
||||||
|
ss -lntu 2>/dev/null | awk '/:53 /{print}' | head -5
|
||||||
|
echo
|
||||||
|
echo "=== Masked resolved units ==="
|
||||||
|
systemctl is-enabled systemd-resolved.service systemd-resolved-varlink.socket systemd-resolved-monitor.socket 2>&1 | paste -d' ' - - - -
|
||||||
|
}
|
||||||
|
|
||||||
|
add_fallback_dns() {
|
||||||
|
if grep -q "nameserver $FALLBACK" "$RESOLV" 2>/dev/null; then
|
||||||
|
echo "$FALLBACK is already in $RESOLV — nothing to do."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "nameserver $FALLBACK" >> "$RESOLV"
|
||||||
|
echo "Added fallback nameserver $FALLBACK to $RESOLV."
|
||||||
|
echo "Test:"
|
||||||
|
getent hosts archlinux.org && echo " DNS now resolves."
|
||||||
|
}
|
||||||
|
|
||||||
|
restart_agh() {
|
||||||
|
systemctl restart adguardhome
|
||||||
|
sleep 1
|
||||||
|
systemctl is-active adguardhome
|
||||||
|
journalctl -u adguardhome -b --no-pager -n 10 | tail -10
|
||||||
|
}
|
||||||
|
|
||||||
|
unmask_resolved() {
|
||||||
|
cat <<MSG
|
||||||
|
This rolls back the local-DNS setup partway:
|
||||||
|
- unmasks systemd-resolved + its varlink/monitor sockets
|
||||||
|
- starts systemd-resolved (will bind 127.0.0.53:53)
|
||||||
|
- does NOT change /etc/resolv.conf, NetworkManager dropin, or nsswitch.conf
|
||||||
|
|
||||||
|
Use this if AGH itself is broken and you want resolved back as a stopgap.
|
||||||
|
You will still need to point /etc/resolv.conf at 127.0.0.53 (or let NM regenerate it)
|
||||||
|
to actually use resolved.
|
||||||
|
|
||||||
|
MSG
|
||||||
|
read -rp "Proceed? [y/N] " ans
|
||||||
|
[[ "$ans" =~ ^[Yy]$ ]] || { echo "Cancelled."; return; }
|
||||||
|
systemctl unmask systemd-resolved.service systemd-resolved-varlink.socket systemd-resolved-monitor.socket
|
||||||
|
systemctl start systemd-resolved
|
||||||
|
systemctl status systemd-resolved --no-pager -n 5
|
||||||
|
}
|
||||||
|
|
||||||
|
menu() {
|
||||||
|
cat <<MENU
|
||||||
|
|
||||||
|
DNS rescue menu:
|
||||||
|
1) Show DNS status (resolv.conf, AGH state, log, port 53)
|
||||||
|
2) Add $FALLBACK as a temporary fallback nameserver
|
||||||
|
3) Restart AdGuard Home and tail its log
|
||||||
|
4) Unmask + start systemd-resolved (heavier rollback)
|
||||||
|
5) Open editor on /etc/resolv.conf
|
||||||
|
q) Quit
|
||||||
|
MENU
|
||||||
|
read -rp "> " choice
|
||||||
|
case "$choice" in
|
||||||
|
1) show_status ;;
|
||||||
|
2) add_fallback_dns ;;
|
||||||
|
3) restart_agh ;;
|
||||||
|
4) unmask_resolved ;;
|
||||||
|
5) "${EDITOR:-vi}" "$RESOLV" ;;
|
||||||
|
q|Q) exit 0 ;;
|
||||||
|
*) echo "Unknown choice." ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
require_root "$@"
|
||||||
|
|
||||||
|
if [[ $# -gt 0 ]]; then
|
||||||
|
case "$1" in
|
||||||
|
status) show_status ;;
|
||||||
|
fallback) add_fallback_dns ;;
|
||||||
|
restart) restart_agh ;;
|
||||||
|
unmask) unmask_resolved ;;
|
||||||
|
*) echo "Usage: $0 [status|fallback|restart|unmask] (no arg = interactive menu)"; exit 2 ;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
show_status
|
||||||
|
while true; do menu; done
|
||||||
@@ -2,5 +2,9 @@
|
|||||||
|
|
||||||
|
|
||||||
if [ -f /usr/bin/mpv ];then
|
if [ -f /usr/bin/mpv ];then
|
||||||
mpv http://listen.noagendastream.com/noagenda
|
mpv "http://listen.noagendastream.com/noagenda"
|
||||||
|
elif [ -f "/usr/bin/vlc" ];then
|
||||||
|
vlc "http://listen.noagendastream.com/noagenda"
|
||||||
|
else [ -f "/usr/bin/xdg-open" ];then
|
||||||
|
xdg-open "http://listen.noagendastream.com/noagenda"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
pkgname="rtlwifi"
|
pkgname="rtl88x2bu-git"
|
||||||
pkgurl="https://github.com/cilynx/rtl88x2bu.git"
|
pkgurl="https://github.com/RinCat/RTL88x2BU-Linux-Driver.git"
|
||||||
tmpdir="/tmp"
|
tmpdir="/usr/src"
|
||||||
|
|
||||||
_fetch_deps(){
|
_fetch_deps(){
|
||||||
if [ -f /usr/bin/apt ];then
|
if [ -f /usr/bin/apt ];then
|
||||||
apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync
|
sudo apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync
|
||||||
|
|
||||||
elif [ -f /usr/bin/dnf ];then
|
elif [ -f /usr/bin/dnf ];then
|
||||||
dnf group install "Development Tools"
|
sudo dnf group install "Development Tools"
|
||||||
dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget
|
sudo dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget
|
||||||
else
|
else
|
||||||
echo "No supported package manager"
|
echo "No supported package manager"
|
||||||
fi
|
fi
|
||||||
@@ -20,7 +20,7 @@ _fetch_deps(){
|
|||||||
|
|
||||||
_download(){
|
_download(){
|
||||||
if [ ! -d "${tmpdir}"/"${pkgname}" ];then
|
if [ ! -d "${tmpdir}"/"${pkgname}" ];then
|
||||||
git clone "${pkgurl}" "${tmpdir}"/"${pkgname}"
|
sudo git clone "${pkgurl}" "${tmpdir}"/"${pkgname}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,14 +30,10 @@ _apply_patch(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
_install(){
|
_install(){
|
||||||
cd "${tmpdir}"/"${pkgname}" || exit 1
|
sed -i 's/PACKAGE_VERSION="@PKGVER@"/PACKAGE_VERSION="git"/g' /usr/src/rtl88x2bu-git/dkms.conf
|
||||||
#_apply_patch
|
sudo dkms add -m rtl88x2bu -v git
|
||||||
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
|
sudo dkms autoinstall
|
||||||
rsync -rvhP ./ /usr/src/rtl88x2bu-"${VER}"
|
sudo modprobe 88x2bu
|
||||||
dkms add -m rtl88x2bu -v "${VER}"
|
|
||||||
dkms build -m rtl88x2bu -v "${VER}"
|
|
||||||
dkms install -m rtl88x2bu -v "${VER}"
|
|
||||||
modprobe 88x2bu
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_fetch_deps
|
_fetch_deps
|
||||||
|
|||||||
14
steamloop.sh
Executable file
14
steamloop.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Running Steam in Wine causes Steam on Linux to lose connection
|
||||||
|
# This makes it hard to use Steam link if Steam has to be closed to reset
|
||||||
|
# This script just reopens Steam on the host so that Steam link can reconnect.
|
||||||
|
|
||||||
|
while true;do
|
||||||
|
|
||||||
|
if [ -z "$(pidof steam)" ];then
|
||||||
|
sleep 10s
|
||||||
|
/usr/bin/steam
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
7
svc.sh
7
svc.sh
@@ -133,7 +133,12 @@ systemd(){
|
|||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
up)
|
up)
|
||||||
systemctl --type=service --state=running
|
if [[ ! -z "${2}" ]];then
|
||||||
|
systemctl status "${2}"
|
||||||
|
else
|
||||||
|
systemctl --type=service --state=running
|
||||||
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
start)
|
start)
|
||||||
|
|||||||
2
trb.sh
2
trb.sh
@@ -20,7 +20,7 @@ zenity --question --text "Do you want to trim?"
|
|||||||
if [[ $? == 1 ]];then
|
if [[ $? == 1 ]];then
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
notify-send "Trimming..."
|
notify-send -a "FS-Trim" "Trimming..."
|
||||||
echo "Trimming..."
|
echo "Trimming..."
|
||||||
results=$(${su_prompt} /sbin/fstrim -va)
|
results=$(${su_prompt} /sbin/fstrim -va)
|
||||||
notify-send "${results}"
|
notify-send "${results}"
|
||||||
|
|||||||
Reference in New Issue
Block a user