summaryrefslogtreecommitdiff
path: root/ar/.local
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.local')
-rwxr-xr-xar/.local/bin/ecrypt2
-rwxr-xr-xar/.local/bin/hugow28
-rwxr-xr-xar/.local/bin/mounter8
-rwxr-xr-xar/.local/bin/statusbar/sb-ecrypt2
4 files changed, 38 insertions, 2 deletions
diff --git a/ar/.local/bin/ecrypt b/ar/.local/bin/ecrypt
index 4240c71..d16d746 100755
--- a/ar/.local/bin/ecrypt
+++ b/ar/.local/bin/ecrypt
@@ -25,7 +25,7 @@ attempt_mount() {
}
targets="$HOME/.secret"
-mounts="$HOME/Private"
+mounts="$HOME/Secret"
pw="default"
[ -d "$targets" ] || mkdir -p "$targets"
[ -d "$mounts" ] || mkdir -p "$mounts"
diff --git a/ar/.local/bin/hugow b/ar/.local/bin/hugow
index a715606..8860286 100755
--- a/ar/.local/bin/hugow
+++ b/ar/.local/bin/hugow
@@ -3,10 +3,13 @@ set -eu
repodir="$HOME/Private/repos/THESIAH"
out="$repodir/public/diary/index.html"
+out2="$repodir/public/recordings/index.html"
server="${THESIAH_SERVER:-root@thesiah.xyz}"
dest="/var/www/thesiah/diary/"
+dest2="/var/www/thesiah/recordings/"
defaults="sy after foramonth"
src="$repodir/public/diary/"
+src2="$repodir/public/recordings/"
bgm="$repodir/static/bgm/"
bgmd="/var/www/thesiah/bgm/"
@@ -18,7 +21,13 @@ if [ ! -f "$out" ]; then
exit 1
fi
+if [ ! -f "$out2" ]; then
+ echo "error: not found: $out2" >&2
+ exit 1
+fi
+
ssh "$server" "mkdir -p '$dest'"
+ssh "$server" "mkdir -p '$dest2'"
rsync -azv --update --itemize-changes --stats "$bgm" "$server:$bgmd"
@@ -31,6 +40,15 @@ else
"$src" "$server:$dest"
fi
+if [ -n "${THESIAH_SSH_OPTS:-}" ]; then
+ rsync -azv --update --itemize-changes --stats \
+ -e "ssh $THESIAH_SSH_OPTS" \
+ "$src2" "$server:$dest2"
+else
+ rsync -azv --update --itemize-changes --stats \
+ "$src2" "$server:$dest2"
+fi
+
if [ -n "${1-}" ]; then
new="$repodir/content/diary/$1"
if [ -f "$new" ]; then
@@ -40,6 +58,16 @@ if [ -n "${1-}" ]; then
fi
fi
+if [ -n "${1-}" ]; then
+ new="$repodir/content/recordings/$1"
+ if [ -f "$new" ]; then
+ rsync -az --update "$new" "$server:$dest2"
+ elif [ -d "$new" ]; then
+ rsync -az --update "$new/" "$server:$dest2$(basename "$new")/"
+ fi
+fi
+
ssh "$THESIAH_SERVER" "chmod 644 $dest/index.html"
+ssh "$THESIAH_SERVER" "chmod 644 $dest2/index.html"
cd - >/dev/null
diff --git a/ar/.local/bin/mounter b/ar/.local/bin/mounter
index c8eabbf..e62f61b 100755
--- a/ar/.local/bin/mounter
+++ b/ar/.local/bin/mounter
@@ -83,6 +83,13 @@ done | filter)"
# Get all normal, non-encrypted or decrypted partitions that are not mounted.
normalparts="$(echo "$lsblkoutput" | grep -v crypto_LUKS | grep -v 'LVM2_member' | grep -v 'part 1M' | grep 'part\|rom\|crypt' | sed "s/^/💾 /" | filter)"
+# Get unpartitioned raw disks (disks with no partition children that are not mounted).
+rawdisks="$(echo "$lsblkoutput" | awk '
+ $3=="disk" {disks[$2]=$0}
+ $3=="part" {dev=$2; gsub(/p?[0-9]+$/, "", dev); haspart[dev]=1}
+ END {for (d in disks) if (!(d in haspart)) print disks[d]}
+' | sed "s/^/💾 /" | filter)"
+
# Get all available IP addresses with open Samba shares in the wlan0 subnet, excluding eth0 IP
smbips="$(sudo arp-scan --interface=eth0 --interface=wlan0 --localnet | grep -vEi '(EFM Networks|DUP:)' | awk '/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/{print $1}')"
@@ -140,6 +147,7 @@ alldrives="$(echo "$phones
$iphones
$unopenedluks
$normalparts
+$rawdisks
$smbs" | sed "/^$/d;s/ *$//")"
# Quit the script if a sequential command fails.
diff --git a/ar/.local/bin/statusbar/sb-ecrypt b/ar/.local/bin/statusbar/sb-ecrypt
index f07b994..9ba6e26 100755
--- a/ar/.local/bin/statusbar/sb-ecrypt
+++ b/ar/.local/bin/statusbar/sb-ecrypt
@@ -7,4 +7,4 @@ case $BLOCK_BUTTON in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
-mount | grep -q "$HOME/Private" && echo "🔑" || echo "🔒"
+mount | grep -q "$HOME/Secret" && echo "🔑" || echo "🔒"