diff options
author | V3n3RiX <venerix@rogentos.ro> | 2016-03-19 11:46:23 +0000 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2016-03-19 11:46:23 +0000 |
commit | 22a056bfb6285f5e6700f994cf6cfd54b8aedf84 (patch) | |
tree | 17d3392fca1fa6e5c60819ce40937925be675a89 | |
parent | a2231c18ef829f1cb011eefdd857b2ebb66af29e (diff) |
only run if the system is in live mode
-rwxr-xr-x | kogaionlive.sh | 10 |
1 files changed, 9 insertions, 1 deletions
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 |