conflink
f=/var/lib/bind/db.b8.nz
ser stop bind9
-s rm -fv $f.jnl
-s install -m 644 -o bind -g bind /p/c/machine_specific/linode/bind-initial/db.b8.nz $f
+sudo rm -fv $f.jnl
+sudo install -m 644 -o bind -g bind /p/c/machine_specific/linode/bind-initial/db.b8.nz $f
ser restart bind9
EOF
done
hr
e "s lshw -C network"
hr
- s lshw -C network
+ sudo lshw -C network
}
nk() {
ser stop NetworkManager
ser stop dnsmasq
- s resolvconf -d NetworkManager
+ sudo resolvconf -d NetworkManager
ser start dnsmasq
- s ifup br0
+ sudo ifup br0
}
ngo() {
- s ifdown br0
+ sudo ifdown br0
ser start NetworkManager
sleep 4
- s nmtui-connect
+ sudo nmtui-connect
}
otp() {
#rbp() { rbt post -o "$@"; }
rebr() {
- s ifdown br0
- s ifup br0
+ sudo ifdown br0
+ sudo ifup br0
}
resolvcat() {
}
spend() {
- s systemctl suspend
+ sudo systemctl suspend
}
# ssh, copy my universal config over if needed.
done
fi
else
- dorsync=true
# use this weird yes thing to ensure we know ssh succeeded
if ! tmp=$(command ssh "${args[@]}" "$remote" "if test -e /a/bin/ds/.bashrc -a -L .bashrc; then echo yes; fi"); then
echo failed sl test. doing plain ssh -v
if [[ $tmp == yes ]]; then
type=a
else
+ dorsync=true
type=b
fi
fi
- if [[ $type == b ]] && $dorsync; then
- if ! RSYNC_RSH="ssh ${args[*]}" rsync -rptL /b/ds/sl/.iank "$remote":; then
- echo WARNING: rsync failed. remove $sshinfo to try again
- fi
+ if $dorsync; then
+ RSYNC_RSH="ssh ${args[*]}" rsync -rptL /b/ds/sl/.iank "$remote":
fi
if $dorsync || ! $haveinfo; then
sshinfo=/p/sshinfo/$now$type"$remote"
chmod 666 $sshinfo
fi
if [[ $type == b ]]; then
- if $dorsync; then
- RSYNC_RSH="ssh ${args[*]}" rsync -rptL /b/ds/sl/.iank "$remote":
- fi
if (( ${#@} )); then
# Theres a couple ways to do this. im not sure whats best,
[[ $1 ]] || { echo need arg; return 1; }
journalctl --unit=$vpn_service@$1 -f -n0 &
- s systemctl start $vpn_service@$1
+ sudo systemctl start $vpn_service@$1
# sometimes the ask-password agent does not work and needs a delay.
sleep .5
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779240
# noticed around 8-2017 after update from around stretch release
# on debian testing, even though the bug is much older.
- s systemd-tty-ask-password-agent
+ sudo systemd-tty-ask-password-agent
}
vpnoff() {
else
local vpn_service=openvpn
fi
- s systemctl stop $vpn_service@$1
+ sudo systemctl stop $vpn_service@$1
}
vpnoffc() { # vpn off client
ser stop openvpn-nn@client