--- elwix/config/etc/default/rc.initial 2013/01/27 23:28:32 1.1.2.2 +++ elwix/config/etc/default/rc.initial 2013/08/05 13:10:17 1.5 @@ -2,7 +2,7 @@ # # ELWIX Initial RC Menu script # -# $Id: rc.initial,v 1.1.2.2 2013/01/27 23:28:32 misho Exp $ +# $Id: rc.initial,v 1.5 2013/08/05 13:10:17 misho Exp $ # trap : 2 @@ -40,11 +40,14 @@ menu() echo echo "Available interfaces: $IFACES" read -p " +Which from them: " iface + if [ -z "$iface" ]; then + return 1 + fi read -p " +Name of interface $iface []: " name read -p " +Setup management vlan 4093 on $iface? [no|yes]: " mgmt read -p " +IPv4 address/mask of interface $iface [dhcp|x.x.x.x/x]: " ip4 read -p " +IPv6 address/mask of interface $iface [auto|x:x:x::x/x]: " ip6 - if [ X"$mgmt" = X"yes" -o X"$mgmt" = "y" ]; then + if [ X"$mgmt" = X"yes" -o X"$mgmt" = X"y" ]; then cfexec sh -c "echo $iface >/etc/mylan" fi ifconfig $iface description "$name" up @@ -83,9 +86,9 @@ menu() echo echo "Restore factory defaults ..." read -p " +Are you sure for restore and clear all changes? [no|yes]: " ans - if [ X"$ans" = X"yes" -o X"$ans" = "y" ]; then + if [ X"$ans" = X"yes" -o X"$ans" = X"y" ]; then cfexec rm -rf /elwix/etc/rc.S /elwix/etc/rc.s /elwix/etc/rc.t - cfexec tar -xzpf /elwix/backup/.var.tgz -C /elwix/altroot + cfexec tar -xzpf /elwix/altroot/backup/.var.tgz -C /elwix/altroot cfexec tar -xzpf /elwix/altroot/backup/.etc.tgz -C /elwix fi ;; @@ -104,20 +107,22 @@ menu() ssh -p ${port:-22} -l ${user:-$USER} ${host:-localhost} ;; 8) - $SHELL + exec $SHELL ;; 9) echo camcontrol devlist echo - read -p " +Select drive [like: ada1]: " dev - if [ -n "$dev" ]; then - if `disklabel $dev`; then - read -p " +This is right choice? [no|yes]: " ask - if [ X"$ask" = X"yes" -o X"$ask" = X"y" ]; then - sysctl -w kern.geom.debugflags=16 - dd if=/dev/ufs/elwix of=/dev/$dev - sysctl -w kern.geom.debugflags=0 + read -p " +Select copy from drive [like: ada0]: " src + read -p " +Select copy to drive [like: ada1]: " dst + if [ -n "$src" -a -n "$dst" ]; then + if [ -x /usr/sbin/diskinfo ]; then + diskinfo $dst + if [ $? -eq 0 ]; then + read -p " +This is right choice? [no|yes]: " ask + if [ X"$ask" = X"yes" -o X"$ask" = X"y" ]; then + dd if=/dev/$src of=/dev/$dst + fi fi fi fi