view mount-crypt @ 19:e245a271fc44

Add scripts for recording/displaying CPU and GPU activity Graphing is based on sensors-graph, but recording is a Python script because more processing is required than logging temperatures. CPU/GPU recording will hopefully be useful to work out what causes occasional lags in games - is it just I/O Wait (despite the SSD)?
author IBBoard <dev@ibboard.co.uk>
date Mon, 01 Oct 2018 20:52:26 +0100
parents 14e726efe9b0
children
line wrap: on
line source

#! /bin/bash

if [ $# -ne 1 ]; then
	echo "Usage: $0 <filename>" >&2
	exit 1
fi

if [ ! -f "$1" ]; then
	echo "File doesn't exist" >&2
	exit 2
fi

LOOP_DEV=$(su -c "losetup --find --show \"$1\"")
MAPPER=${LOOP_DEV##*/}
su -c "cryptsetup luksOpen $LOOP_DEV $MAPPER && mkdir -p /media/$MAPPER && mount /dev/mapper/$MAPPER /media/$MAPPER"