Moderator: Moderators
#!/bin/sh
HOSTNM=`hostname`
DATE=$(date +"%d-%b-%y %H:%M")
df -k | grep <mount_point> | grep -v grep > /dev/null
if [ $? == 1 ]; then
touch /tmp/nfs.temp
echo '===ALERT===' >> /tmp/nfs.temp
echo '' >> /tmp/nfs.temp
echo 'Mount Points Offline!' $HOSTNM $DATE >> /tmp/nfs.temp
echo '' >> /tmp/nfs.temp
echo 'TRACE:' >> /tmp/nfs.temp
echo '' >> /tmp/nfs.temp
tail -n -15 /var/log/messages >> /tmp/nfs.temp
echo '' >> /tmp/nfs.temp
mount <mount_point_1>
mount <mount_point_2>
echo 'Filesystems Have Been Remounted:' >> /tmp/nfs.temp
echo '' >> /tmp/nfs.temp
df -h >> /tmp/nfs.temp
mail -s "$DATE ALERT" <email_address> < /tmp/nfs.temp
rm /tmp/nfs.temp
else echo > /dev/null
fi
tail -n -100 /var/log/messages
equo install wicd
/usr/bin/rc-config delete NetworkManager default;
/usr/bin/rc-config add wicd default
#!/bin/bash
# Network Management script
clear
_COLUMNS=$(tput cols)
_LINES=$(tput lines)
# Set default message if $1 input not provided
_MESSAGE="${1:-Network Management Switcher}"
# Calculate x and y coordinates so that we can display $MESSAGE
# centered in the screen
#x=$(( $_LINES / 2 ))
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# Clear the screen
tput clear
# set x and y position
#tput cup $x $y
tput cup 0 $y
# set reverse video mode
tput rev
# Alright display message stored in $_MESSAGE
echo "${_MESSAGE}"
# Start cleaning up our screen...
#tput clear
tput sgr0
#tput rc
#############################################
echo ''
echo 'Please choose an option:'
echo ''
options=(
"Start wicd"
"Start NetworkManager"
"Enable wicd at boot"
"Enable NetworkManager at boot"
"Launch wicd-curses interface"
"Check configured IP address"
"Check wireless service"
"Launch Wavemon"
"Mount server"
"Check storage usage"
"Show Temperatures"
"Check ntp status"
"Print Menu"
"Clear Screen"
"Reboot"
"Quit"
)
select opt in "${options[@]}"; do
case $REPLY in
1)
echo "Stopping NetworkManager";
/etc/init.d/NetworkManager stop;
sleep 10;
echo "Starting wicd";
/etc/init.d/wicd start
;;
2)
echo "Stopping wicd";
/etc/init.d/wicd stop;
sleep 10;
echo "Starting NetworkManager";
/etc/init.d/NetworkManager start
;;
3)
echo "Disabling NetworkManager from startup";
/usr/bin/rc-config delete NetworkManager default;
echo "Enabling wicd at startup";
/usr/bin/rc-config add wicd default
;;
4)
echo "Disabling wicd from startup";
/usr/bin/rc-config delete wicd default;
echo "Enabling NetworkManager at startup";
/usr/bin/rc-config add NetworkManager default
;;
5)
echo "Launching wicd-curses....";
sleep 5;
/usr/bin/wicd-curses
;;
6)
echo "Checking configured IP address";
sleep 5;
/bin/ifconfig
;;
7)
echo "Checking wireless connection";
/sbin/iwconfig
;;
8)
echo "Launching Wavemon....";
sleep 5;
/usr/bin/wavemon
;;
9)
echo "Mounting server shares:";
/bin/mount <share_1>;
sleep 2;
/bin/mount <share_2>;
echo "Shares have been mounted";
/bin/df -h
;;
b)
echo "Temperatures:";
echo "";
/usr/bin/sensors
;;
a)
echo "Checking file system storage usage";
echo "";
/bin/df -h
;;
c)
echo "Checking ntp connection";
echo "";
sleep 5;
/usr/bin/ntpq -p
;;
m)
echo "
1) Start wicd
2) Start NetworkManager
3) Enable wicd at boot
4) Enable NetworkManager at boot
5) Launch wicd-curses interface
6) Check configured IP address
7) Check wireless service
8) Launch Wavemon
9) Mount server
a) Check storage usage
b) Show Temperatures
c) Check ntp status
m) Print Menu
c) Clear Screen
r) Reboot
q) Quit
"
;;
w)
clear
;;
r)
/sbin/init 6
;;
q|Q)
echo "bye...";
break;;
esac
done
tput clear
Return to Sabayon Linux General Discussion
Users browsing this forum: No registered users and 2 guests