::bash shell scripts::

first line of a script should be: #!/bin/bash (path to shell that the script will be executed from)

mudportrun
A script that checks to see if a MUD is running on a particular port. The port number should be changed of course to whichever your MUD runs on. If the MUD is already running the script will reply so. If the MUD will not start or something strange is happening it will reply that the MUD cannot be started.

CHECK=`ps ux | grep -c "6104"`
if [ $CHECK = "2" ]
then
echo "Sorry, port 6104 is already running."
else
cd Mud/quick/QuickMUD/area
csh -f ./startup &
cd ~
CHECK2=`ps ux | grep -c "6104"`
if [ $CHECK2 = "2" ]
then
echo "Port 6104 started successfully!"
else
echo "There was an error loading 6104 :("
fi
fi

mudstartup
A friendly menu that uses instances of the mudportrun script to start MUDs on different ports.

clear
echo " ~Start Menu~ "
echo "============================="
echo "[1] Start Player's Port 6100"
echo "[2] Start Builder's Port 6101"
echo "[3] Start Migration Port 6104"
echo "[4] Exit"
echo "============================="

read ENTRY
case $ENTRY in
[1]) playrun ;;
[2]) buildrun ;;
[3]) quickrun ;;
[4]) echo "ByE!" ;;
*) echo "Please enter a valid choice"; startup ;;
esac

homebackup.sh
Script that backs up a user's home dir and then archives and compresses it along with datestamping the filename.

#!/bin/bash

#backup script
#backup user's home dir and compress it with bzip
#based heavily upon  a backup script from mandrake linux documentation
#the rest all by eric m. bouse
#version: 0.1

TEMP_DEST_DIR="/tmp/backups"
FINAL_DEST_DIR="$HOME/backups"
DATESTAMP=`date '+%m%d%Y'`

mkdir $HOME/backups
mkdir /tmp/backups
tar cvjf $TEMP_DEST_DIR/backup.tar.bz2 $HOME
mv $TEMP_DEST_DIR/backup.tar.bz2 $FINAL_DEST_DIR/backup_home_$DATESTAMP.tar.bz2


lowercase.sh
Converts filenames to lowercase in current directory. Relies on "convmv" utility.

#!/bin/bash
convmv --lower --notest *

rsync_backup.sh
rsync -a -v -r -c --progress --stats --delete /home/resinblade/Desktop/backup/ -e ssh resinblade@192.168.1.7:/storage5