From 5f120ae34681a55a61ced78d0c482a3ac9375345 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 13 Mar 2016 08:22:51 +0000 Subject: add live user on the fly, no more need to embed it into iso --- kogaionlive.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 kogaionlive.sh (limited to 'kogaionlive.sh') diff --git a/kogaionlive.sh b/kogaionlive.sh new file mode 100755 index 0000000..7aaa6b6 --- /dev/null +++ b/kogaionlive.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +export local liveuser="kogaion" + +checkroot () { + if [[ "$(whoami)" != root ]] ; then + echo "" + echo "You're not root?...No cookies for you, go away !!!" + echo "" + exit 1 + fi +} + +kogaion_add_live_user() { + /usr/sbin/useradd -u 10000 -g 100 -o -m -s /bin/bash "$liveuser" > /dev/null 2>&1 +} + +kogaion_live_user_groups() { + for group in tty disk lp wheel uucp console audio cdrom tape video cdrw usb plugdev messagebus portage ; do + gpasswd -a "$liveuser" "$group" > /dev/null 2>&1 + done +} + +kogaion_live_user_password () { + /usr/bin/passwd --delete "$liveuser" > /dev/null 2>&1 +} + +main () { + if checkroot ; then + kogaion_add_live_user + kogaion_live_user_groups + kogaion_live_user_password + fi +} + +main +exit 0 + -- cgit v1.2.3