mkbackup-btrfs/files/usr/local/bin/syssubvol.old
2019-03-05 13:20:31 +01:00

15 lines
354 B
Bash
Executable file

#!/bin/bash
#mawk '$5 ~ "^/$" {gsub ("/","",$4);print $4}' /proc/self/mountinfo
#SV1=$(basename "$(grub-mkrelpath /)")
SV1="XXX"
[ -x /bin/cat ] || exit 1
SV2=$(grep -sq "=subvol=" /proc/cmdline && /bin/cat /proc/cmdline |sed 's/^.*=subvol=\([^ ]*\) .*$/\1/')
#echo "SV1: $SV1 SV2: $SV2"
if [ "$SV1" == "$SV2" ];then
echo "$SV1"
else
echo "$SV2"
fi