为了方便安装人员,把所有的动作放到scripts里面,不过debian和ubuntu的安装部分的设定也还是有点差别。
If you choose Debian:
When Install begin ,choose Chinese(Taiwai)
1.copy sources.list
2.apt-get update
3.apt-get install telnetd xinetd wine vsftpd
4.setup *.conf
5.copy wine.tar.gz from 0.9 and SFCS.sh to ~/Desktop and $HOME
6.apt-get install ttf-arphic-uming
7.set firefox main page to http://10.87.0.31
8.font to Wending,desktop change from 4->1
9.xorg.conf 24->16,menu.lst 5->0
10.initab,6->2 c
If you choose ubuntu:
When Install begin,choose english.
download the scripts install_sfw.sh and execute it.
Scripts:
Version1:
#!/bin/sh
TMPFILE=/tmp/install_sfw.tmp
SERVERIP=10.87.0.9

ww=`id|grep uid=0|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Current user must be ROOT,please switch to ROOT first!
exit
fi

ww=`cat /etc/passwd |grep mkluser:|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Can not find the user MKLUSER,please create it first!
exit
fi

echo Test network if it is ok
if [ `ifconfig eth0 |grep "inet addr"|wc -l` -eq 0 ]; then
ifdown eth0
ifup eth0
fi

if [ `ping -c 3 $SERVERIP | grep "$FSTR" |wc -l` -gt 0 ]; then
echo `date`:Network Connecting Test OK!
else
echo `date`:Netowrk Connecting Test Failed,Please Check it!
exit
fi

if [ -f /apt.tar.gz ] || [ -f /apt.tar ] ; then
echo find apt compress file,continue
else
echo [ERR]Missing apt.tar.gz ,downloading...
echo open 10.87.0.9 > $TMPFILE
echo user root admin009 >>$TMPFILE
echo hash >>$TMPFILE
echo prompt >>$TMPFILE
echo lcd / >>$TMPFILE
echo cd sfcswin >>$TMPFILE
echo mget apt.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n
fi

if [ -f /wine_sfcs.tar.gz ] || [ -f /wine_sfcs.tar ] ; then
echo find sfcs compress file,continue
else
echo [ERR]Missing wine_sfcs.tar.gz ,downloading...
echo open 10.87.0.9 > $TMPFILE
echo user root admin009 >>$TMPFILE
echo prompt >>$TMPFILE
echo hash >>$TMPFILE
echo lcd / >>$TMPFILE
echo cd sfcswin >>$TMPFILE
echo mget wine_sfcs.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n
fi
if [ -f /apt.tar.gz ] && [ -f /wine_sfcs.tar.gz ] ; then
echo Download OK
else
echo Download failed ,please check !
exit 0
fi

echo Uncompress the tar files
cd /
gzip -d *.gz
chown -R mkluser:mkluser /home/mkluser
tar xvpf ./apt.tar
tar xvpf ./wine_sfcs.tar

echo Install wine,telnetd,vsftpd
cd /home/mkluser/.wine/sfcsinst/
dpkg -i binfmt-support*.deb
dpkg -i libaudio2*.deb
dpkg -i wine*.deb
dpkg -i xinetd*.deb
dpkg -i telnetd*.deb
dpkg -i vsftpd*.deb

echo Open the service telnetd,vsftpd,X
cp /home/mkluser/.wine/sfcsinst/vsftpd.conf /etc/
cp /home/mkluser/.wine/sfcsinst/SFCS.SH /home/mkluser/Desktop/
cp /home/mkluser/.wine/sfcsinst/xinetd.conf /etc/
cp /home/mkluser/.wine/sfcsinst/telnet /etc/xinetd.d/
cp /home/mkluser/.wine/sfcsinst/gdm.conf /etc/gdm/
/etc/init.d/xinetd restart
/etc/init.d/vsftpd restart
/etc/init.d/gdm restart

echo Update login menu, set the default time to 0
sed -i 's/timeout[[:blank:]]*3/timeout 0/g' /boot/grub/menu.lst

echo Decreasing the number of tty and color bit
cp /home/mkluser/.wine/sfcsinst/tty* /etc/event.d/
sed -i 's/DefaultDepth 24/DefaultDepth 16/g' /etc/X11/xorg.conf


echo Increase the performance of wine
cp -rpf /home/mkluser/.wine/sfcsinst/zh_* /usr/share/X11/locale/

echo Install chinese language support
cd /var/cache/apt/archives/
dpkg -i language-pack-gnome-zh-base_*.deb
dpkg -i language-pack-gnome-zh_1*.deb
apt-get install language-pack-gnome-zh-base
dpkg -i language-pack-zh-base_*.deb
dpkg -i language-pack-zh_1*.deb
apt-get install language-pack-zh

echo Adjust TIMEZONE
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

echo Revoke sudo right from MKLUSER
chmod 0740 /etc/sudoers
cp /home/mkluser/.wine/sfcsinst/sudoers /etc/
chmod 0440 /etc/sudoers

echo Install finished, rebooting ...
init 6
Version 2:和1的区别就是,不用设置mkluser的一些咚咚,但是也会带来一些问题,如键盘布局等,让人头疼。
#!/bin/sh
TMPFILE=/tmp/install_sfw.tmp
SERVERIP=10.87.0.9

ww=`id|grep uid=0|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Current user must be ROOT,please switch to ROOT first!
exit
fi

ww=`cat /etc/passwd |grep mkluser:|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Can not find the user MKLUSER,please create it first!
exit
fi

echo Test network if it is ok
if [ `ifconfig eth0 |grep "inet addr"|wc -l` -eq 0 ]; then
ifdown eth0
ifup eth0
fi

if [ `ping -c 3 $SERVERIP | grep "$FSTR" |wc -l` -gt 0 ]; then
echo `date`:Network Connecting Test OK!
else
echo `date`:Netowrk Connecting Test Failed,Please Check it!
exit
fi

rm /apt.tar*
rm /mkluser_sfcs.tar*
echo Downloading install files,please wait...
echo open 10.87.0.9 > $TMPFILE
echo user sfcswin sfcswin >>$TMPFILE
echo hash >>$TMPFILE
echo prompt >>$TMPFILE
echo lcd / >>$TMPFILE
echo mget apt.tar.gz >>$TMPFILE
echo mget mkluser_sfcs.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n

if [ -f /mkluser_sfcs.tar.gz ] && [ -f /apt.tar.gz ] ; then
echo Download OK,continue...
else
echo Download install files failed ,please check !
exit 0
fi

echo Uncompress the tar files
cd /
gzip -d *.gz
tar xvpf ./apt.tar
tar xvpf ./mkluser_sfcs.tar
chown -R mkluser:mkluser /home/mkluser

echo Install wine,telnetd,vsftpd
cd /home/mkluser/sfcsinst/
dpkg -i binfmt-support*.deb
dpkg -i libaudio2*.deb
dpkg -i wine*.deb
dpkg -i xinetd*.deb
dpkg -i telnetd*.deb
dpkg -i vsftpd*.deb

echo Open the service telnetd,vsftpd,X
cp /home/mkluser/sfcsinst/vsftpd.conf /etc/
cp /home/mkluser/sfcsinst/xinetd.conf /etc/
cp /home/mkluser/sfcsinst/telnet /etc/xinetd.d/
cp /home/mkluser/sfcsinst/gdm.conf /etc/gdm/
echo export LANG=zh_TW.UTF-8 >>/home/mkluser/.bashrc
echo export LC_ALL=zh_TW.UTF-8 >>/home/mkluser/.bashrc
/etc/init.d/xinetd restart
/etc/init.d/vsftpd restart
/etc/init.d/gdm restart

echo Update login menu, set the default time to 0
sed -i 's/timeout[[:blank:]]*3/timeout 0/g' /boot/grub/menu.lst
sed -i 's/timeout[[:blank:]]*10/timeout 0/g' /boot/grub/menu.lst

echo Decreasing the number of tty and color bit
cp /home/mkluser/sfcsinst/tty* /etc/event.d/
sed -i 's/DefaultDepth[[:blank:]]*24/DefaultDepth 16/g' /etc/X11/xorg.conf


echo Increase the performance of wine
cp -rpf /home/mkluser/sfcsinst/zh_* /usr/share/X11/locale/

echo Install chinese language support
cd /var/cache/apt/archives/
dpkg -i language-pack-gnome-zh-base_*.deb
dpkg -i language-pack-gnome-zh_1*.deb
apt-get install language-pack-gnome-zh-base
dpkg -i language-pack-zh-base_*.deb
dpkg -i language-pack-zh_1*.deb
apt-get install language-pack-zh

echo Adjust TIMEZONE
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

echo Revoke sudo right from MKLUSER
chmod 0740 /etc/sudoers
cp /home/mkluser/sfcsinst/sudoers /etc/
chmod 0440 /etc/sudoers

echo Install finished, rebooting ...
init 6
If you choose Debian:
When Install begin ,choose Chinese(Taiwai)
1.copy sources.list
2.apt-get update
3.apt-get install telnetd xinetd wine vsftpd
4.setup *.conf
5.copy wine.tar.gz from 0.9 and SFCS.sh to ~/Desktop and $HOME
6.apt-get install ttf-arphic-uming
7.set firefox main page to http://10.87.0.31
8.font to Wending,desktop change from 4->1
9.xorg.conf 24->16,menu.lst 5->0
10.initab,6->2 c
If you choose ubuntu:
When Install begin,choose english.
download the scripts install_sfw.sh and execute it.
Scripts:
Version1:
#!/bin/sh
TMPFILE=/tmp/install_sfw.tmp
SERVERIP=10.87.0.9
ww=`id|grep uid=0|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Current user must be ROOT,please switch to ROOT first!
exit
fi
ww=`cat /etc/passwd |grep mkluser:|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Can not find the user MKLUSER,please create it first!
exit
fi
echo Test network if it is ok
if [ `ifconfig eth0 |grep "inet addr"|wc -l` -eq 0 ]; then
ifdown eth0
ifup eth0
fi
if [ `ping -c 3 $SERVERIP | grep "$FSTR" |wc -l` -gt 0 ]; then
echo `date`:Network Connecting Test OK!
else
echo `date`:Netowrk Connecting Test Failed,Please Check it!
exit
fi
if [ -f /apt.tar.gz ] || [ -f /apt.tar ] ; then
echo find apt compress file,continue
else
echo [ERR]Missing apt.tar.gz ,downloading...
echo open 10.87.0.9 > $TMPFILE
echo user root admin009 >>$TMPFILE
echo hash >>$TMPFILE
echo prompt >>$TMPFILE
echo lcd / >>$TMPFILE
echo cd sfcswin >>$TMPFILE
echo mget apt.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n
fi
if [ -f /wine_sfcs.tar.gz ] || [ -f /wine_sfcs.tar ] ; then
echo find sfcs compress file,continue
else
echo [ERR]Missing wine_sfcs.tar.gz ,downloading...
echo open 10.87.0.9 > $TMPFILE
echo user root admin009 >>$TMPFILE
echo prompt >>$TMPFILE
echo hash >>$TMPFILE
echo lcd / >>$TMPFILE
echo cd sfcswin >>$TMPFILE
echo mget wine_sfcs.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n
fi
if [ -f /apt.tar.gz ] && [ -f /wine_sfcs.tar.gz ] ; then
echo Download OK
else
echo Download failed ,please check !
exit 0
fi
echo Uncompress the tar files
cd /
gzip -d *.gz
chown -R mkluser:mkluser /home/mkluser
tar xvpf ./apt.tar
tar xvpf ./wine_sfcs.tar
echo Install wine,telnetd,vsftpd
cd /home/mkluser/.wine/sfcsinst/
dpkg -i binfmt-support*.deb
dpkg -i libaudio2*.deb
dpkg -i wine*.deb
dpkg -i xinetd*.deb
dpkg -i telnetd*.deb
dpkg -i vsftpd*.deb
echo Open the service telnetd,vsftpd,X
cp /home/mkluser/.wine/sfcsinst/vsftpd.conf /etc/
cp /home/mkluser/.wine/sfcsinst/SFCS.SH /home/mkluser/Desktop/
cp /home/mkluser/.wine/sfcsinst/xinetd.conf /etc/
cp /home/mkluser/.wine/sfcsinst/telnet /etc/xinetd.d/
cp /home/mkluser/.wine/sfcsinst/gdm.conf /etc/gdm/
/etc/init.d/xinetd restart
/etc/init.d/vsftpd restart
/etc/init.d/gdm restart
echo Update login menu, set the default time to 0
sed -i 's/timeout[[:blank:]]*3/timeout 0/g' /boot/grub/menu.lst
echo Decreasing the number of tty and color bit
cp /home/mkluser/.wine/sfcsinst/tty* /etc/event.d/
sed -i 's/DefaultDepth 24/DefaultDepth 16/g' /etc/X11/xorg.conf

echo Increase the performance of wine
cp -rpf /home/mkluser/.wine/sfcsinst/zh_* /usr/share/X11/locale/
echo Install chinese language support
cd /var/cache/apt/archives/
dpkg -i language-pack-gnome-zh-base_*.deb
dpkg -i language-pack-gnome-zh_1*.deb
apt-get install language-pack-gnome-zh-base
dpkg -i language-pack-zh-base_*.deb
dpkg -i language-pack-zh_1*.deb
apt-get install language-pack-zh
echo Adjust TIMEZONE
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo Revoke sudo right from MKLUSER
chmod 0740 /etc/sudoers
cp /home/mkluser/.wine/sfcsinst/sudoers /etc/
chmod 0440 /etc/sudoers
echo Install finished, rebooting ...
init 6
#!/bin/sh
TMPFILE=/tmp/install_sfw.tmp
SERVERIP=10.87.0.9
ww=`id|grep uid=0|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Current user must be ROOT,please switch to ROOT first!
exit
fi
ww=`cat /etc/passwd |grep mkluser:|wc -l`
if [ $ww -eq 0 ] ; then
echo [ERR]Can not find the user MKLUSER,please create it first!
exit
fi
echo Test network if it is ok
if [ `ifconfig eth0 |grep "inet addr"|wc -l` -eq 0 ]; then
ifdown eth0
ifup eth0
fi
if [ `ping -c 3 $SERVERIP | grep "$FSTR" |wc -l` -gt 0 ]; then
echo `date`:Network Connecting Test OK!
else
echo `date`:Netowrk Connecting Test Failed,Please Check it!
exit
fi
rm /apt.tar*
rm /mkluser_sfcs.tar*
echo Downloading install files,please wait...
echo open 10.87.0.9 > $TMPFILE
echo user sfcswin sfcswin >>$TMPFILE
echo hash >>$TMPFILE
echo prompt >>$TMPFILE
echo lcd / >>$TMPFILE
echo mget apt.tar.gz >>$TMPFILE
echo mget mkluser_sfcs.tar.gz >>$TMPFILE
echo by >>$TMPFILE
cat $TMPFILE |ftp -n
if [ -f /mkluser_sfcs.tar.gz ] && [ -f /apt.tar.gz ] ; then
echo Download OK,continue...
else
echo Download install files failed ,please check !
exit 0
fi
echo Uncompress the tar files
cd /
gzip -d *.gz
tar xvpf ./apt.tar
tar xvpf ./mkluser_sfcs.tar
chown -R mkluser:mkluser /home/mkluser
echo Install wine,telnetd,vsftpd
cd /home/mkluser/sfcsinst/
dpkg -i binfmt-support*.deb
dpkg -i libaudio2*.deb
dpkg -i wine*.deb
dpkg -i xinetd*.deb
dpkg -i telnetd*.deb
dpkg -i vsftpd*.deb
echo Open the service telnetd,vsftpd,X
cp /home/mkluser/sfcsinst/vsftpd.conf /etc/
cp /home/mkluser/sfcsinst/xinetd.conf /etc/
cp /home/mkluser/sfcsinst/telnet /etc/xinetd.d/
cp /home/mkluser/sfcsinst/gdm.conf /etc/gdm/
echo export LANG=zh_TW.UTF-8 >>/home/mkluser/.bashrc
echo export LC_ALL=zh_TW.UTF-8 >>/home/mkluser/.bashrc
/etc/init.d/xinetd restart
/etc/init.d/vsftpd restart
/etc/init.d/gdm restart
echo Update login menu, set the default time to 0
sed -i 's/timeout[[:blank:]]*3/timeout 0/g' /boot/grub/menu.lst
sed -i 's/timeout[[:blank:]]*10/timeout 0/g' /boot/grub/menu.lst
echo Decreasing the number of tty and color bit
cp /home/mkluser/sfcsinst/tty* /etc/event.d/
sed -i 's/DefaultDepth[[:blank:]]*24/DefaultDepth 16/g' /etc/X11/xorg.conf

echo Increase the performance of wine
cp -rpf /home/mkluser/sfcsinst/zh_* /usr/share/X11/locale/
echo Install chinese language support
cd /var/cache/apt/archives/
dpkg -i language-pack-gnome-zh-base_*.deb
dpkg -i language-pack-gnome-zh_1*.deb
apt-get install language-pack-gnome-zh-base
dpkg -i language-pack-zh-base_*.deb
dpkg -i language-pack-zh_1*.deb
apt-get install language-pack-zh
echo Adjust TIMEZONE
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo Revoke sudo right from MKLUSER
chmod 0740 /etc/sudoers
cp /home/mkluser/sfcsinst/sudoers /etc/
chmod 0440 /etc/sudoers
echo Install finished, rebooting ...
init 6
Ubuntu自动化安装脚本
本文介绍了一种适用于Ubuntu系统的自动化安装脚本,该脚本能够完成包括网络测试、软件包下载与安装、服务配置及系统调整等一系列自动化操作,极大地提高了Ubuntu系统部署的效率。
9397

被折叠的 条评论
为什么被折叠?



