terminal Crash and no root access
I am new here. What I did is that : I made a .sh script and move that script in /bin/bash. Now I am trying to open terminal but it disappear with an error /bin/bash : mail not found. Please help me out
#!/bin/sh
# Shell script to monitor or watch the disk space
# It will send an email to $ADMIN, if the (free avilable) percentage
# of space is >= 90%
# -------
# Copyright (c) 2005 nixCraft project <http://
# This script is licensed under GNU GPL version 2.0 or above
# -------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://
# -------
# Linux shell script to watch disk space (should work on other UNIX oses )
# SEE URL: http://
# set admin email so that you can get email
<email address hidden>"
# set alert level 90% is default
ALERT=25
df -H | grep -vE '^Filesystem|
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s "Alert: Almost out of disk space $usep" $ADMIN
fi
done
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu bash Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask CARE for more information if necessary.