-#!/bin/bash
+#!/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "❌ This script must be run as root." >&2
-#!/bin/bash
+#!/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "❌ This script must be run as root." >&2
-#!/usr/bin/env bash
+#!/bin/env bash
# disable_linger_subu — turn off systemd --user lingering for all <masu>-* users
# Usage: sudo disable_linger_subu --masu Thomas
-#!/usr/bin/env bash
+#!#!/bin/env bash
# logout_subu — cleanly stop subu users, tear down bindfs, unbind /home, unmount device, close LUKS
# Usage:
# sudo logout_subu --masu Thomas --device Eagle [--aggressive] [--dry-run]
-#!/bin/bash
+#!/bin/env bash
# Function to list users in the /mnt/<device>/user_data directory
device_user_list() {
-#!/bin/bash
+#!/bin/env bash
# Function to bind mount a user's data to /home/<user>
device_user_bind() {
+#!/bin/env bash
# masu__map_own_all.sh
-#!/bin/bash
+
set -euo pipefail
masu="${1:?Usage: $0 <masu> [--suid=subu1,subu2] }"
suid_list="${2-}" # optional: --suid=a,b,c
-#!/bin/bash
+#!/bin/env bash
# Function to list sub-users in /home/<user>/subu_data
subu_home_dir_list() {
+#!/bin/env bash
# masu__subu_dir_list.sh
-#!/bin/bash
+
set -euo pipefail
user="${1:?usage: $0 <masu>}"
+#!/bin/env bash
# masu_subu__map_own.sh
-#!/bin/bash
+
# usage: sudo ./masu_subu__map_own.sh <masu> <subu> [--suid]
set -euo pipefail
-#!/bin/bash
+#!/bin/env bash
# Function to bind mount with UID/GID mapping
subu_bind() {
-#!/bin/bash
+#!/bin/env bash
# Function to lookup the UID of the user and sub-user combination
get_subu_uid() {
-#!/bin/bash
+#!/bin/env bash
# Function to list available devices under /mnt, excluding /mnt itself
mount_pt_list() {