about summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-08-19 22:41:11 +0100
committerSilvino Silva <silvino@bk.ru>2016-08-19 22:41:11 +0100
commitaa990cd7e4f7be6e760e9cbdd402041dfecca8c7 (patch)
treee777962d96cddf8e31d1d21d5c671bb91aecfb83 /scripts
parentaac1d3295f8abbaa05945900a89490be98355f80 (diff)
downloaddoc-aa990cd7e4f7be6e760e9cbdd402041dfecca8c7.tar.gz
initial core configure script and doc
Diffstat (limited to 'scripts')
-rw-r--r--scripts/configure.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/configure.sh b/scripts/configure.sh
new file mode 100644
index 0000000..e812bda
--- /dev/null
+++ b/scripts/configure.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+ADMIN_USER=c9admin
+#ADMIN_PASS=
+
+DIR=$(dirname "$PWD");
+DIR_CONF=$DIR"/conf"
+
+printf "DIR_CONF="$DIR"\n";
+printf "DIR_CONF="$DIR_CONF"\n";
+printf "ADMIN_USER="$ADMIN_USER"\n"
+
+printf "1.1.3 mount point to chroot (/mnt):"
+read CHROOT
+
+#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 -m -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:"