该文接续之前写过的一篇:。
这是我个人用来进行树莓派盒子安装配置的脚本,对于外部其他博友,可以部分参考,但不需要逐个引用。
现在有一定更新,部分按如下脚本来操作:
step1:
sudo groupadd wingspansudo useradd -g wingspan -d /home/lifeccp -m lifeccp -p lifeccpsudo cp /etc/sudoers /etc/sudoers.default.baksudo sed -i '21a lifeccp ALL=(ALL:ALL) ALL' /etc/sudoerssudo passwd lifeccp#sudo visudo
step2:
# 退出,使用lifeccp账户登录ssh-keygen -t rsatar -cvf ssh.tar.gz .sshcat .ssh/id_rsa.pubcat .ssh/id_rsa# get infosudo cat /proc/cpuinfo | grep Serial | awk '{print $3}' > a.txtsudo ifconfig | grep HWaddr >> a.txtsudo ifconfig | grep HWaddr | awk '{print $5}' >> a.txtcat a.txt
step3:
sudo service ssh startsudo service ssh status--------服务配置mkdir -p /home/lifeccp/webappmkdir -p /home/lifeccp/dicomsudo apt-get install chkconfigcd /home/lifeccp/webapp上传文件sudo chmod +x /home/lifeccp/webapp/pandion/servesudo chmod +x /home/lifeccp/webapp/pandion/startupsudo chmod +x /home/lifeccp/webapp/pandion/pandion-v1.0.7.release.jarsudo chmod +x /home/lifeccp/webapp/osprey/servesudo chmod +x /home/lifeccp/webapp/osprey/startupsudo chmod +x /home/lifeccp/webapp/osprey/osprey-v1.0.21.release.jar*sudo cp /home/lifeccp/webapp/pandion/serve /etc/init.d/pandionsudo cp /home/lifeccp/webapp/osprey/serve /etc/init.d/ospreysudo chmod +x /etc/init.d/ospreysudo chmod +x /etc/init.d/pandionsudo chkconfig --listsudo chkconfig --add ospreysudo chkconfig --add pandionsudo chkconfig --list pandionsudo chkconfig --list osprey
step4:
sudo apt-get install nginx -ysudo chkconfig --add nginxsudo chkconfig --level 2345 nginx on# sudo apt-get install nginx -ysudo cp /home/lifeccp/webapp/nginx-conf-prod/osprey.conf /etc/nginx/conf.d/osprey.confsudo cp /etc/hosts /etc/hosts.baksudo sed -i '$a 59.110.47.149 ef.lifeccp.com' /etc/hostssudo cp /etc/nginx/conf.d/osprey.conf /etc/nginx/conf.d/osprey.conf.bak# sudo sed -i '1i upstream ef.lifeccp.com { \n server 59.110.47.149:80 max_fails=2 fail_timeout=30s ; \n } ' /etc/nginx/conf.d/osprey.confsudo sed -i '5i Welcome!You can send Email to nianhuaiju@qq.com,If the computer malfunctions.' /etc/motdsudo userdel -rf pisudo groupdel pi
step5:
sudo vi /etc/dhcpcd.confinterface eth0static ip_address=192.168.21.135/24static routers=192.168.21.1#static domain_name_servers=223.5.5.5 223.6.6.6static domain_name_servers=218.30.19.40 61.134.1.4
或者:
sudo sed -i '$a interface eth1\n static ip_address=192.168.21.135/24\n static routers=192.168.21.1\n #static domain_name_servers=218.30.19.40 61.134.1.4' /etc/dhcpcd.conf# sudo sed -i '$a # static domain_name_servers=223.5.5.5 223.6.6.6' /etc/dhcpcd.conf
step6:重启
sudo reboot
step7:
(待续)