|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 110 article |
2002-02-23 09:19:18 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
ºñ´©°¡ ¾²´Â °èÁ¤&µðºñ »ý¼º ½ºÅ©¸³Æ® |
|
|
[root@Tina zboard]# 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 777 /home/$1/htmlroot/zboard
# À¥È£½ºÆà ȨÇÇ °èÁ¤Á¤º¸ °ü·Ã ½ºÅ©¸³Æ® ½ÇÇà
/etc/startup/homelink.sh
# Á¦·Îº¸µå ÀÌ¿ë 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>" >> /home/$1/htmlroot/index.html
if [ "$zbd" = "n" ] || [ "$zbd" = "N" ]; then
echo "<br>" >> /home/$1/htmlroot/index.html
else
echo "Á¦·Îº¸µå ¼³Ä¡ ¹öÁ¯ : 4.1 (from 2002.2.23)<br>" >> /home/
$1/htmlroot/index.html
echo "<a href=/~$1/zboard/install.php>¼³Ä¡È¸é°¡±â</a><br><br>"
>> /home/$1/htmlroot/index.html
fi
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
|
|
Page Loading [ 0.03 Sec ]
SQL Time [ 0 Sec ]
|
|
|