echo no args
fi
for arg; do
- printf "%qEOL\n" "${!arg}"
- printf "%s" "${!arg}" |& hexdump -C
+ if [[ -v $arg ]]; then
+ printf "%qEOL\n" "${!arg}"
+ printf "%s" "${!arg}" |& hexdump -C
+ else
+ echo arg $arg is unset
+ fi
done
}
sk() {
- # 2029: "unescaped, this expands on the client side." yes, I know how ssh works
- # 2164: "Use 'cd ... || exit' or 'cd ... || return' in case cd fails." i have automatic error handling
- # 2086: unquoted $var
+
+
+ # note, if you do something like this
+ # x=( prefix* )
+ # then disable the warning with:
+ # shellcheck disable=SC2206 # globbing is intended
+
+ # 2029: "unescaped, this expands on the client side.": yes, I know how ssh works
+ # 2164: "Use 'cd ... || exit' or 'cd ... || return' in case cd fails.": i have automatic error handling
+ # 2086: unquoted $var: Quoting every var I set is way too much quotes.
+ # 2068: Double quote array expansions to avoid re-splitting elements: same as above.
+ # 2033: command arg is a function name: too many false positives.
+
+
+ # these ones I had disabled, but without a good written explanation, so enabling them temporarily
# 2046: unquoted $(cmd)
- # 2068: Double quote array expansions to avoid re-splitting elements.
# 2119: Functions with optional args get bad warnings when none are passed.
- # 2033: too many false positives for thing that will never work, passing shell function to find.
- # i had -x as an arg, but debian testing(stretch) doesn\'t support it
- shellcheck -x -e 2029,2164,2086,2046,2068,2119,2033 "$@" || return $?
- # had this before. not sure what it is 2119
+
+ shellcheck -W 999 -x -e 2029,2164,2086,2068,2033 "$@" || return $?
}
# other tiling window managers in giving up on setting it at all
#
xprop -root -remove _NET_WORKAREA
- command pumpa &r
+ command pumpa & r
}
# reviewboard, used at my old job
(sleep $(calc "$* * 60") && mpv --no-config --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 &
}
-trg() { transmission-remote-gtk&r; }
+trg() { transmission-remote-gtk & r; }
trc() {
# example, set global upload limit to 100 kilobytes:
# trc -u 100
m sudo -E env "PATH=$PATH" nsenter -t $(pgrep -f "/usr/sbin/openvpn .* --config /etc/openvpn/.*client.conf") -n -m "$@"
}
vpnf() {
- vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn &r
+ vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn & r
}
vpn2f() {
- vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 &r
+ vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 & r
}
vpni() {
sudo dd of=/etc/systemd/system/keyscriptoff.service <<'EOF'
[Unit]
-Description=keyscriptoffIMG_20200803_221621
+Description=keyscriptoff
[Service]
Type=oneshot
#!/bin/bash
+## in development, meant to be run manually
+
[[ $EUID == 0 ]] || exec sudo -E "$script" "$@"
if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
set -x
+d=(/dev/mapper/crypt_dev*)
+d=${d[0]}
+
+mount -o subvol=root_trisquelnabia $d /mnt
-boot_part=$(awk '$2 == "/boot" {print $1}' /etc/mtab)
-boot_dev=${boot_part%[0-9]*}
-# from partition.DEFAULT
-new_boot_part=${boot_dev}4
-mount -o subvol=debianbuster_bootstrap $new_boot_part /mnt
+boot_part=$(awk '$2 == "/" {print $1}' /etc/mtab)
+mount -o subvol=boot_trisquelnabia $boot_part /mnt/boot
cd /mnt
mount -o bind /dev dev
mount -o bind /sys sys
mkdir -p boot/efi
mount $(awk '$2 == "/boot/efi" {print $1}' /etc/mtab) boot/efi
+chroot .
+# then run zboot-chroot
# /sbin/update-initramfs: 157: mkinitramfs: not found
PATH="/sbin:$PATH"
+if [[ $INVOCATION_ID ]]; then
+ if [[ -e /b/bash_unpublished/source-state ]]; then
+ source /b/bash_unpublished/source-state
+ fi
+ if [[ $MAIL_HOST && $MAIL_HOST != $HOSTNAME ]]; then
+ echo "$0: exiting early: running under systemd as MAIL_HOST"
+ exit 0
+ fi
+fi
+
if [[ ! -e /tmp/keyscript-off ]]; then
if [[ $($sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
if ! grep -q '^\s*FILES=' /etc/mkinitcpio.conf; then
+++ /dev/null
-/b/exim-tools/ex
\ No newline at end of file