dotfiles

Alpine Linux dotfiles

git clone git://git.lin.moe/dotfiles.git

 1#!/usr/bin/env sh
 2set -e
 3
 4DOAS=${DOAS:-"doas"}
 5
 6if [[ "$#" == "1" ]];  then
 7	_chroot="$1"
 8elif [ -z "$CHROOT" ] ; then
 9	>&2 echo '$CHROOT unset'
10	exit 1
11fi
12
13if [ ! -d "$_chroot" ] ; then
14	>&2 echo "Directory $_chroot not exists"
15	exit 1
16fi
17
18
19for ent in "run" "dev/pts" "dev" "sys" proc; do
20    if mountpoint -q "$_chroot/$ent" ; then
21	$DOAS umount "$_chroot/$ent"	
22    else
23	>&2 echo "WARNING: $_chroot/$ent is not mounted"
24    fi
25done
26
27exit 0