最后看一下install.sh
#!/bin/bash source ../common/tool.sh glassfishUser="glassfish" glassfishGroup="glassfishadm" recreateSystemUserAndFolder $glassfishUser recreateUserGroup $glassfishGroup usermod -a -G $glassfishGroup $glassfishUser chgrp -R $glassfishGroup /home/$glassfishUser cp -r ./glassfish3/* /home/$glassfishUser/ cp -r ./glassfish3/.org.opensolaris,pkg /home/$glassfishUser/.org.opensolaris,pkg chown -R $glassfishUser /home/$glassfishUser chmod -R ug+rwx /home/$glassfishUser/bin/ chmod -R ug+rwx /home/$glassfishUser/glassfish/bin/ chmod -R o-rwx /home/$glassfishUser/bin/ chmod -R o-rwx /home/$glassfishUser/glassfish/bin/ cp ./glassfish /etc/init.d/ update-rc.d glassfish defaults service glassfish start每次都会先删除已存在的用户和组,以及目录。
最后给出目录结构:
$ tree -L 1
.
├── glassfish
├── glassfish3
└── install.sh
1 directory, 2 files
chenshu@sloop2:~/work/1