1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#!/bin/sh
# lessdisks-terminal-install
# the purpose of this script is to set up the group and/or user, add /etc/fstab
# entries and populate the $rw directory on the server, just for the fun of it.
# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.
if [ -r /etc/ok-to-install ]; then
echo "/etc/ok-to-install file exists, proceeding with install"
else
echo "/etc/ok-to-install does not exist..."
echo "are you trying to install on the server's root directory?"
echo "that can break your server real good."
echo " "
echo "try installing the lessdisks-install package first"
echo "then:"
echo "run lessdisks-install"
echo " "
echo "exiting..."
exit
fi
#source config file
. /etc/lessdisks/server.config
if [ -z "$rw" ]
then
rw="/var/state/lessdisks/"
fi
mkdir -pv $rw/etc
# TODO- include option for generating a root and lessdisks_user password
# it's currently empty, most likely...
####
echo "making fstab"
echo "$disk_alias:$lessdisks_path / nfs defaults,ro,nolock 0 0" > /etc/fstab
echo "none /proc proc defaults 0 0" >> /etc/fstab
if [ "yes" = "$floppy" ] || [ "true" = "$floppy" ]; then
echo "/dev/fd0 /floppy vfat,ext2,hfs,auto defaults,noauto,user" >> /etc/fstab
fi
if [ "yes" = "$cdrom" ] || [ "true" = "$cdrom" ]; then
echo "/dev/cdrom /cdrom isofs,auto defaults,noauto,user" >> /etc/fstab
fi
if [ "yes" = "$group_only" ] || [ "true" = "$group_only" ]; then
lessdisks_gid=`cut -d ":" -f 3 /etc/lessdisks/gid`
if [ -z "$lessdisks_gid" ]; then
echo "WARNING: no group id found in /etc/lessdisks/gid"
else
echo "chgrp -R $lessdisks_gid /etc/lessdisks"
chgrp -R $lessdisks_gid /etc/lessdisks
fi
else
lessdisks_uid=`cut -d ":" -f 2 /etc/lessdisks/uid_gid`
lessdisks_gid=`cut -d ":" -f 3 /etc/lessdisks/uid_gid`
chown -R $lessdisks_uid.$lessdisks_gid /etc/lessdisks
fi
chmod g+ws /etc/lessdisks/oldconfigs
chmod g+w /etc/lessdisks/terminals.config
# set up loopback devices, so khttpd works
echo "auto lo" >> /etc/network/interfaces
echo "iface lo inet loopback" >> /etc/network/interfaces
# call script to make network bootable kernel images
if [ -x /usr/sbin/update-lessdisks-kernels ]; then
/usr/sbin/update-lessdisks-kernels
fi
echo "lessdisks terminal-install done!"
|