about summary refs log tree commit diff stats
path: root/core/scripts/configure.sh
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-08-22 16:35:00 +0100
committerSilvino Silva <silvino@bk.ru>2016-08-22 20:08:05 +0100
commit1ac5f126bf1b3f2e18001dab8b9f2ae6255309cf (patch)
tree0383468088621583e29e1e8be1fdeeceb3ec0d14 /core/scripts/configure.sh
parent05c1ad5f7378e421f8ea06fb55e44ec773f0f055 (diff)
downloaddoc-1ac5f126bf1b3f2e18001dab8b9f2ae6255309cf.tar.gz
first doc core os revision
Diffstat (limited to 'core/scripts/configure.sh')
-rw-r--r--core/scripts/configure.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/core/scripts/configure.sh b/core/scripts/configure.sh
new file mode 100644
index 0000000..f279725
--- /dev/null
+++ b/core/scripts/configure.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+ADMIN_USER=c9admin
+CHROOT=/mnt
+#ADMIN_PASS=
+
+DIR=$(dirname "$PWD");
+DIR_CONF=$DIR"/conf"
+
+printf "CHROOT="$CHROOT"\n";
+printf "DIR="$DIR"\n";
+printf "DIR_CONF="$DIR_CONF"\n";
+printf "ADMIN_USER="$ADMIN_USER"\n"
+read PAUSE
+
+
+#configure_crux() {
+
+    echo "1.2.1. Set hostname and hosts;"
+    cp $DIR_CONF/hosts $CHROOT/etc/
+    vim $CHROOT/etc/hosts
+
+    echo "1.2.2. Set timezone;"
+    chroot $CHROOT /bin/bash -c tzselect
+
+    echo "1.2.3. Set locale;"
+    chroot $CHROOT /bin/bash -c "localedef -i en_US -f UTF-8 en_US.UTF-8"
+
+    echo "1.2.4.2. Create Administrator $ADMIN_USER;"
+
+    chroot $CHROOT /usr/bin/env -i \
+        HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
+        PATH=/bin:/usr/bin:/sbin:/usr/sbin \
+        /bin/bash -c "useradd -U -m -k /etc/skel -s /bin/bash $ADMIN_USER"
+
+#    echo "$ADMIN_USER:$ADMIN_PASS" >$CHROOT/root/foo
+#    chroot $CHROOT 'chpasswd </root/foo'
+#    rm $CHROOT/root/foo
+#
+    echo "1.2.4.3. Add Administrator $ADMIN_USER to wheel group;"
+    chroot $CHROOT /bin/bash -c "usermod -a -G wheel $ADMIN_USER"
+    echo "1.2.4.3. Uncomment to allow members of group wheel to execute any command\n
+#    %wheel ALL=(ALL) ALL"
+     cp $DIR_CONF/sudoers $CHROOT/etc/
+
+    echo "1.2.5. File system table;"
+    cp $DIR_CONF/fstab $CHROOT/etc/
+    blkid >> $CHROOT/etc/fstab
+    vim $CHROOT/etc/fstab
+
+    echo "1.2.6. Initialization Scripts;"
+    cp $DIR_CONF/rc.conf $CHROOT/etc/
+    vim $CHROOT/etc/rc.conf
+
+#}
+
+printf "Chroot to /mnt and set root and admin password:\n"