Update 2025-08-20 22:21 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2025-08-20 22:21:12 +02:00
parent 6028f3a023
commit ff04acca3a

46
.kshrc
View File

@ -139,13 +139,13 @@ gitstatus() {
if [ $(id -u) -eq 0 ]
then
PS1="${x}${RED}\${?}|\w\\$ ${RESET}${x}"
PS1="${x}${RED}$(hostname -s) \${?}|\w\\$ ${RESET}${x}"
else
if command -v git > /dev/null
then
PS1="${x}${GREY}\${?}|\w\$(gitstatus)\\$ ${RESET}${x}"
PS1="${x}${GREY}$(hostname -s) \${?}|\w\$(gitstatus)\\$ ${RESET}${x}"
else
PS1="${x}${GREY}\${?}|\w\\$ ${RESET}${x}"
PS1="${x}${GREY}$(hostname -s) \${?}|\w\\$ ${RESET}${x}"
fi
fi
@ -240,44 +240,8 @@ mygot-clone() {
alias portroach="portroach-cli -m codevoid"
alias ugrep="\ugrep -nI --exclude=tags --exclude=.tags --exclude='cscope.*'"
alias tarsnap="doas \tarsnap"
alias ts="doas tailscale"
ts-configure() {(
set -x
ts up \
--reset \
--exit-node=dalek \
--accept-dns=false \
--accept-routes=true \
--advertise-connector=false \
--advertise-exit-node=false \
--report-posture \
--exit-node-allow-lan-access=false \
--shields-up=false
)}
ts-up() {
route4=$(route -n show -inet | grep -E "default.*trunk0" | awk '{ print $2 }')
if [ ! -z "$route4" ]
then
echo "$route4" > /tmp/ts.route4.backup
doas route del -inet default $route4
fi
route6=$(route -n show -inet6 | grep -E "default.*trunk0" | awk '{ print $2 }')
if [ ! -z "$route6" ]
then
echo "$route6" > /tmp/ts.route6.backup
doas route del -inet6 default $route6
fi
ts up
doas route add -inet default $(ifconfig tun0 inet | grep inet | awk '{ print $2 }')
doas route add -inet6 default $(ifconfig tun0 inet6 | grep inet6 | tail -1 | awk '{ print $2 }')
}
ts-down() {
ts down
doas route del -inet default $(ifconfig tun0 inet | grep inet | awk '{ print $2 }')
doas route del -inet6 default $(ifconfig tun0 inet6 | grep inet6 | tail -1 | awk '{ print $2 }')
doas route add -inet default $(< /tmp/ts.route4.backup)
doas route add -inet6 default $(< /tmp/ts.route6.backup)
}
alias vpn-on="doas wg-quick up /etc/wireguard/wg0.conf"
alias vpn-off="doas wg-quick up /etc/wireguard/wg0.conf"
mystuff() {
cd /usr/ports/mystuff