Correct some thypos (not all ;-))
This commit is contained in:
parent
b5e2309033
commit
e0ab2d466c
2 changed files with 21 additions and 22 deletions
12
README.md
12
README.md
|
@ -1,6 +1,6 @@
|
|||
# my-scripts
|
||||
|
||||
My personally or users our LUG-VS used scripts
|
||||
My personally or users, our LUG-VS used scripts
|
||||
|
||||
See also at [LUG-VS-Wiki Nützliche Scripte](https://lug-vs.org//lugvswiki/index.php?title=Nuetzliche_Scripte) (German)
|
||||
|
||||
|
@ -9,11 +9,11 @@ See also at [LUG-VS-Wiki Nützliche Scripte](https://lug-vs.org//lugvswiki/index
|
|||
|
||||
|Script|Description|
|
||||
|---|---|
|
||||
|[duc-index.sh](duc-index.sh)|Script to be added e.g. as cronjob, which generate an index w/o nfs and dfs filesystem mounted files|
|
||||
|[duc-index.sh](duc-index.sh)|Script to be added e.g. as cronjob, which generate an index w/o NFS and DavFS file system mounted files|
|
||||
|[dfc.sh](dfc.sh)|Script shows the free memory of all mounted file systems beside *tmpfs|
|
||||
|[make_exif-name.sh](make_exif-name.sh)|Add a comment in all *.jpg files in the actuall and all subfolders|
|
||||
|[write-exif-comment.sh](write-exif-comment.sh)|Write JPEG EXIF comment in all *.jpg pocures|
|
||||
|[make_exif-name.sh](make_exif-name.sh)|Add a comment in all *.jpg files in the actual and all subfolders|
|
||||
|[write-exif-comment.sh](write-exif-comment.sh)|Write JPEG EXIF comment in all *.jpg files|
|
||||
|[utf8.sh](utf8.sh)|Convert text from e.g. Windows latin1 to utf8 text (e.g. in READMEs or other text (not for office documents))|
|
||||
|[SchredderHDD.sh](SchredderHDD.sh)|Delete a mechanical Hard Disk (HDD) in a relayeable way to ensure before forward it to the recycling, that no old data are there|
|
||||
|[wmf2svg.sh](wmf2svg.sh)|Example script converts WMF files in SVG to share it easily in the internet|
|
||||
|[SchredderHDD.sh](SchredderHDD.sh)|Delete a mechanical Hard Disk (HDD) reliably to ensure before forward it to the recycling, that no old data are there|
|
||||
|[wmf2svg.sh](wmf2svg.sh)|Example script converts WMF files in SVG to share it easily on the internet|
|
||||
|
||||
|
|
29
dfc.sh
29
dfc.sh
|
@ -3,35 +3,34 @@
|
|||
# df with some options and colored if Alert levels are exceeded
|
||||
# (c) GPL by Ulf Bartolomäus
|
||||
VERSION="Version 0.1.1 from 13.02.2021"
|
||||
|
||||
# 0.1.1
|
||||
# Initial based on whatch_new
|
||||
|
||||
MyDfC='df -hTx tmpfs -x devtmpfs' ## df - command - w/o *tenpfs
|
||||
MyDfCnN='df -hTx tmpfs -x devtmpfs -x fuse -x nfs4' ## df - command - w/o *tenpfs, fusa and nfs4
|
||||
#MyDfC="${MyDfCnN}" ## zweite verusion statt erste
|
||||
MyDfCnN='df -hTx tmpfs -x devtmpfs -x fuse -x nfs4' ## df - command - w/o *tenpfs, fuse and nfs4
|
||||
#MyDfC="${MyDfCnN}" ## uncomment to overwrite wit additional fuse and nfs4 filesystems
|
||||
MyDfAlert1=80 ## alert level of df
|
||||
MyDfAlert2=90 ## critical alert level of df
|
||||
|
||||
## Escape secences for color
|
||||
esc=$(echo -en "\033") ## define esc secence
|
||||
dick="${esc}[1m" ## define bold secence
|
||||
rot="${esc}[1;31m" ## define red secence
|
||||
gruen="${esc}[1;32m" ## define green secence
|
||||
gelb="${esc}[1;33m" ## define yelow secence
|
||||
blau="${esc}[1;34m" ## define blue secence
|
||||
lila="${esc}[1;35m" ## define purple secence
|
||||
norm=$(echo -en "${esc}[m\017") ## define default secence
|
||||
## Escape sequences for color
|
||||
esc=$(echo -en "\033") ## define esc sequence
|
||||
dick="${esc}[1m" ## define bold sequence
|
||||
rot="${esc}[1;31m" ## define red sequence
|
||||
gruen="${esc}[1;32m" ## define green sequence
|
||||
gelb="${esc}[1;33m" ## define yellow sequence
|
||||
blau="${esc}[1;34m" ## define blue sequence
|
||||
lila="${esc}[1;35m" ## define purple sequence
|
||||
norm=$(echo -en "${esc}[m\017") ## define default sequence
|
||||
|
||||
## DiskFree (only if not the same device => uniq check first 40 characters
|
||||
${MyDfC} | uniq -w40 | while read MyOutput; do ## Execute df and filter doublicates - for each row stored in MyOutput
|
||||
MyDfUsage=$(echo ${MyOutput} | awk '{ print $6}' | cut -d'%' -f1 ) ## Search Usage in %
|
||||
if [[ ! $( echo "${MyDfUsage}" | grep [[:digit:]] ) ]] ; then ## If first row
|
||||
echo -e ${dick}"${MyOutput}"${norm} ## Echo in bold
|
||||
elif [ $(( ${MyDfUsage} )) -ge ${MyDfAlert2} ]; then ## If critical level excided
|
||||
elif [ $(( ${MyDfUsage} )) -ge ${MyDfAlert2} ]; then ## If critical level excited
|
||||
echo -e ${rot}"${MyOutput}"${norm} ## Echo in red
|
||||
elif [ $(( ${MyDfUsage} )) -ge ${MyDfAlert1} ]; then ## If alert level excided
|
||||
echo -e ${gelb}"${MyOutput}"${norm} ## Echo in yelow
|
||||
elif [ $(( ${MyDfUsage} )) -ge ${MyDfAlert1} ]; then ## If alert level excited
|
||||
echo -e ${gelb}"${MyOutput}"${norm} ## Echo in yellow
|
||||
else ## default
|
||||
echo -e ${gruen}"${MyOutput}"${norm} ## Echo in green
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue