>> Read No. 2252 article  
[호스팅] 계정&디비 추가 스크립트

등록 2002-02-22 15:47:00     조회 5
이름 풀비누    

		죄송합니다. html 에 체크하는 바람에..emoticon;
여러곳에 있는 것을 짜집기 해서 만들었습니다.
부족하지만 참고하시기 바랍니다.
 계정아이디=디비네임=디비유저, 계정비번=디비비번과 같도록
처리하였습니다. 
 [root@Tina /]# cat /usr/sbin/addon
#!/bin/sh
          if [ $# = 0 ] # 그냥, addon하면 나오는 부분
         then
                 echo ""
                 echo "addon is Tina's user creator"
                 echo "usage: addon user_name"
                 echo ""
                 exit 1
         fi
          echo ""
         echo "Starting addon:   Running configure..." # 말장난이 조금
많죠...
         echo ""
          # 이미 유저가 존재할 수 있으므로 if문을 섰구요.. 유저가 있으
면
         # 스크립트가 종료됩니다.
          if useradd $1
         then         
                 passwd $1 # 패스워드 부여!
                 echo ""
                 echo "$1 is"
                 echo "`id $1` &" # 유저를 확인하는 차원에서...
          # /etc/skel/htmlroot/zboard 자 계정이 생성되면서 자동으로 복사
                  chmod 711 /home/$1 
                 chmod 707 /home/$1/htmlroot/zboard
          # 제로보드 이용 or 불이용 확인
 echo -n "Zboard Install - [Y/N](default Y) : "
read zbd
        if [ "$zbd" = "n" ] || [ "$zbd" = "N" ]; then
                 rm -rf /home/$1/htmlroot/zboard
                 echo "zboard is removed"
        fi
        # 계정 생성후 메세지
                  echo "Home Permission=711, tokens updated
successfully!"
                 echo ""
         # 계정 사용자의 index.html 문서 생성
 rm -rf /home/$1/htmlroot/index.html
 echo "" >> /home/$1/htmlroot/index.html
echo "<html>" >> /home/$1/htmlroot/index.html
echo "<body bgcolor=black>" >> /home/$1/htmlroot/index.html
echo "<table align=center>" >> /home/$1/htmlroot/index.html
echo "<tr>" >> /home/$1/htmlroot/index.html
echo "<td align=center>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<font color=ffcc66>" >> /home/$1/htmlroot/index.html
echo "<h3>TINA.WOWDNS.COM</h3>" >> /home/$1/htmlroot/index.html
echo "<h1>회원님의 가입을 축하드립니다.</h1>" >>
/home/$1/htmlroot/index.html
echo "</font>" >> /home/$1/htmlroot/index.html
echo "</td>" >> /home/$1/htmlroot/index.html
echo "</tr>" >> /home/$1/htmlroot/index.html
echo "<tr>" >> /home/$1/htmlroot/index.html
echo "<td align=right>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<h4>" >> /home/$1/htmlroot/index.html
echo "<font color=cyan>" >> /home/$1/htmlroot/index.html
echo "가입일 : $('date')<br><br>" >> /home/$1/htmlroot/index.html
echo "</font>" >> /home/$1/htmlroot/index.html
echo "<font color=dddddd>" >> /home/$1/htmlroot/index.html
echo "웹주소 : http://cel.xdns.co.kr:8888/~$1<br>" >>
/home/$1/htmlroot/index.html
echo "http://tina.wowdns.com/~$1<br>" >>
/home/$1/htmlroot/index.html
echo "</font>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<br>" >> /home/$1/htmlroot/index.html
echo "<a href=/><font color=dddddd>홈으로</font></a><br>"
>> /home/$1/htmlroot/index.html
echo "</h4>" >> /home/$1/htmlroot/index.html
echo "</td>" >> /home/$1/htmlroot/index.html
echo "</tr>" >> /home/$1/htmlroot/index.html
echo "</table>" >> /home/$1/htmlroot/index.html
echo "</body>" >> /home/$1/htmlroot/index.html
echo "</html>" >> /home/$1/htmlroot/index.html
 chown $1.$1 /home/$1/htmlroot/index.html
 ### DB SETTING ###
 echo -n "$1 -DB Passwd:"
read PASS
 echo "create database $1;" > /tmp/useradd.sql
echo "grant all privileges on $1.* to $1@localhost identified
by '${PASS}';" >>
/tmp/useradd.sql
 #echo "use mysql;" > /tmp/useradd.sql
#echo "create database $1;" >> /tmp/useradd.sql
#echo "insert into user (Host,User,Password)
values('localhost','$1',password('${PASS}'));" >> /tmp/useradd.sql
#echo "insert into db
values
('localhost','$1','$1','y','y','y','y','y','y','y','y','y','y');" >>
/tmp/useradd.sql
#echo "flush privileges;" >> /tmp/useradd.sql
 # mysql -u root -p비밀번호 mysql < /tmp/useradd.sql
mysql < /tmp/useradd.sql
rm -rf /tmp/useradd.sql
                  exit
         else
                 echo ""
                 exit 1
          fi--니끼가? 내끼다. 니해뿌라~ emoticon;
이름
암호
  목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.34 초 ] 작업시간: [ 0.03 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1791043020
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.