From 22a056bfb6285f5e6700f994cf6cfd54b8aedf84 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 19 Mar 2016 11:46:23 +0000 Subject: only run if the system is in live mode --- kogaionlive.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kogaionlive.sh b/kogaionlive.sh index 7e0c773..4f2bd25 100755 --- a/kogaionlive.sh +++ b/kogaionlive.sh @@ -11,6 +11,14 @@ checkroot () { fi } +kogaion_is_live() { + if [[ ! -L "/dev/mapper/live-rw" ]] ; then + echo "" + echo "The system is not running in live mode, aborting!" + exit 1 + fi +} + kogaion_add_live_user() { /usr/sbin/useradd -u 1000 -g 100 -o -m -s /bin/bash "$liveuser" > /dev/null 2>&1 } @@ -37,7 +45,7 @@ kogaion_live_locale_switch () { main () { - if checkroot ; then + if checkroot && kogaion_is_live ; then kogaion_add_live_user kogaion_live_user_groups kogaion_live_user_password -- cgit v1.2.3