#!/bin/sh MODULES="" diskfile=/var/lib/lrpkg/pkgpath.disks MODPKG_NAME=modules.tgz TMPDIR=/tmp [ "$MODULES" = "" ] && exit while read i do echo "search $i" mount tmpfs -t tmpfs /lib/modules dev=$(echo $i|awk '{print $1}') type=$(echo $i|awk '{print $2}') mountdir=$TMPDIR/$dev mkdir -p $mountdir mount $dev $mountdir cd /lib/modules [ -f $mountdir/modules.tgz ] && tar zxf /$mountdir/modules.tgz ln -s /lib/modules `uname -r` cd $OLDPWD [ -f /lib/modules/modules.dep ] && for I in $MODULES; do modprobe $I; done umount /lib/modules umount $mountdir done < $diskfile
2013年2月27日 星期三
LEAF 使用 modules.tgz 載入自訂模組
2013年2月18日 星期一
SMTP 使用NC範例
#!/bin/bash
/root/mail_raid_message.sh | nc smtp.server 25 2>&1 >/dev/null
mail_raid_message.sh 內容如下
#!/bin/bash
HELO=smtp.server
FROM=""
TO=""
DATE=$(date '+%a, %d %b %Y %H:%M:%S %z')
echo $DATE
echo "HELO $HELO"
echo "MAIL FROM:$FROM"
echo "RCPT TO:$TO"
echo "DATA"
sleep 1
echo "From:$FROM"
echo "To:$TO"
echo "Date:$DATE"
echo "Subject:$DATE"
echo "mail message"
echo "."
sleep 1
echo "QUIT"
/root/mail_raid_message.sh | nc smtp.server 25 2>&1 >/dev/null
mail_raid_message.sh 內容如下
#!/bin/bash
HELO=smtp.server
FROM="
TO="
DATE=$(date '+%a, %d %b %Y %H:%M:%S %z')
echo $DATE
echo "HELO $HELO"
echo "MAIL FROM:$FROM"
echo "RCPT TO:$TO"
echo "DATA"
sleep 1
echo "From:$FROM"
echo "To:$TO"
echo "Date:$DATE"
echo "Subject:$DATE
echo "mail message"
echo "."
sleep 1
echo "QUIT"
訂閱:
文章 (Atom)