From c3a36879cbd8d8b8a5529b0c32b63f6eb954512b Mon Sep 17 00:00:00 2001 From: l_samenv Date: Tue, 5 Mar 2024 11:29:59 +0100 Subject: [PATCH] makeusb: git must be run as user l_samenv --- makeusb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/makeusb b/makeusb index 3ebdae2..f5299a8 100755 --- a/makeusb +++ b/makeusb @@ -3,6 +3,11 @@ # name of the USB stick to be created NAME=BOOT_TINY +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + # list removeable disks DISKS=() while read LINE @@ -28,7 +33,7 @@ if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then echo "create TinyLinux" if [ ! -d boot_tiny ] ; then - git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git + sudo --user l_samenv git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git fi if [[ $(cat /sys/block/$DEVICE/removable) != "1" ]]; then