#!/bin/sh
# must run as root
# assumes bind is installed on a linux box
# this script has very few sanity checks
# files modified are :
# /etc/named.conf $PZPATH$DOMAIN
# see http://www.ripserve.com/gpl/ for latest version
# the following variables need to be set
PROVIDER=”pearlin.info”
PZPATH=”/etc/named/pz/”
NS1=”darling”
NS2=”blofeld”
MX=$NS2
IP=”62.25.97.28″
TXT=”Ripserve Ltd. London”
if [ $# -lt 1 ]; then
echo “Usage: $0 domain1 domian2 …”
exit 1
fi
USER=$(id | grep root | wc -l)
if [ $USER -eq 0 ]
then
echo “Run this as root to add domains to DNS”
exit 1
fi
mainfunction () {
#create pz file
cat <<EOF > …
Results > Posts Filed Under > scripts
adding Dns entry-script
New mail account creation script for postfix
#!/bin/sh
# must run as root
# only tested on linux using /etc/passwd
# files modified are :
# /etc/passwd , /etc/shadow & /etc/group
# /etc/passwd.md5 for integrity checking
# /home/$USERNAME , and quota file (if it exists)
# /etc/postfix/virtual , $ACCESS & db’s if they exist
# $SQUIRREL/$USERNAME.* if they exist
# the following variables are user-modifiable
#default virtual host
VHOST=”ripserve.com”
#where to mail new account info (to sysadmin)
MAIL=”root@$VHOST”
#path to squirrelmail data, & postfix access file, both optional
SQUIRREL=”/var/lib/squirrelmail/prefs”
ACCESS=”/etc/postfix/sender_access”
PROVIDER=”$VHOST”
QUOTA=”500000 520000 500000 6000000″
function newusermail()
{
cat <<EOF | mail -s “Welcome to $PROVIDER” $USERNAME@$VHOST
$REALNAME, welcome …
disk usage,network,memory..script
#!/bin/sh
# Released under the GPL
# Assumes you’re running linux, bsd will generate less info
# BUGS: bsd produces weird df output
# The following variable is who to email the output to
MAIL=root
HOST=$(hostname)
DATE=$(date +%d/%m/%Y)
USER=$(id | grep root | wc -l)
if [ $USER -eq 0 ]
then
echo “Unless you’re root you won’t get the full reports”
fi
{
echo -e “\n Uptime & load info\n”; w
echo -e “\n\n Disk usage\n”; df -h
df -l | grep dev | awk ‘{t += $2; u += $3} END { printf(“%d MB, …
combined script for Load check,memory & swap,network connections,disk usage.
#!/bin/bash
EMAIL=”linu@pearlin.info”
SUBJECT=”Alert $(hostname) load average is $L05″
TEMPFILE=”/tmp/$(hostname)”
echo “Load average Crossed allowed limit.” >> $TEMPFILE
echo “Hostname: $(hostname)” >> $TEMPFILE
echo “Local Date & Time : $(date)” >> $TEMPFILE
echo “| Uptime status: |” >> $TEMPFILE
echo “——————————————-” >> $TEMPFILE
/usr/bin/uptime >> $TEMPFILE
echo “——————————————-” >> $TEMPFILE
echo “| Top 20 CPU consuming processes: |” >> $TEMPFILE
ps aux | head -1 >> $TEMPFILE
ps aux –no-headers | sort -rn +2 | head -20 >> $TEMPFILE
echo “| Top 10 memory-consuming processes: |” >> $TEMPFILE
ps aux –no-headers| sort -rn +3 | head …