Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2016 update, deprecated scripts removed
- Loading branch information
Fred Brooker
committed
Feb 13, 2016
1 parent
f8389f1
commit b0f1bf0
Showing
18 changed files
with
103 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
Linux shell scripts collection | ||
============================== | ||
|
||
|
||
Author: Fred Brooker <original@fredbrooker.cz> http://fredbrooker.cz/ | ||
author: Fred Brooker https://fredbrooker.cz/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Author: Fred Brooker <original@fredbrooker.cz> | ||
# URL: http://fredbrooker.cz/ | ||
|
||
|
||
which pmi >/dev/null 2>&1 | ||
if [ $? -eq 1 ] | ||
then | ||
echo -e "Installing powermanagement-interface package...\n" | ||
sudo apt-get install powermanagement-interface | ||
sudo apt-get install -yqq powermanagement-interface | ||
fi | ||
|
||
which powermanagement-interface >/dev/null 2>&1 | ||
if [ $? -eq 1 ] | ||
then | ||
echo -e "Powermanagement-interface is not installed!\n" | ||
echo -e "ERROR: Powermanagement-interface is not installed!\n" | ||
exit 1 | ||
fi | ||
|
||
sync | ||
pmi action hibernate | ||
|
||
echo -e "\nDone.\n" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,61 @@ | ||
#!/bin/bash | ||
|
||
# Author: Fred Brooker <original@fredbrooker.cz> | ||
# URL: http://fredbrooker.cz/ | ||
|
||
|
||
if [ $# -eq 0 ] | ||
then | ||
echo -e "\nCheck validity of PDF files recursively.\n\nSyntax: $(basename $0) <folder>\n" | ||
exit 1 | ||
echo -e "\nCheck validity of PDF files recursively.\n\nSyntax: $(basename $0) <folder>\n" | ||
exit 1 | ||
fi | ||
if [ -n "$1" ] | ||
then | ||
if [ -d "$1" ] | ||
then | ||
cd "$1" | ||
else | ||
echo -e "Invalid folder: $1\n" | ||
exit 1 | ||
fi | ||
if [ -d "$1" ] | ||
then | ||
cd "$1" | ||
else | ||
echo -e "Invalid folder: $1\n" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# check for installed app | ||
which pdfinfo >/dev/null 2>&1 | ||
if [ $? -eq 1 ] | ||
then | ||
echo -e "Installing xpdf-utils package...\n" | ||
sudo apt-get install xpdf-utils | ||
echo -e "Installing xpdf-utils package...\n" | ||
sudo apt-get install -yqq xpdf-utils | ||
fi | ||
|
||
which pdfinfo >/dev/null 2>&1 | ||
if [ $? -eq 1 ] | ||
then | ||
echo -e "Xpdf-utils are not installed!\n" | ||
exit 1 | ||
echo -e "ERROR: xpdf-utils are not installed!\n" | ||
exit 1 | ||
fi | ||
|
||
# recurse any directories first | ||
for i in * | ||
do | ||
if [ -d "$i" ] | ||
then | ||
echo "Recursing into directory: $i" | ||
$0 "$i" | ||
fi | ||
if [ -d "$i" ] | ||
then | ||
echo "Recursing into: $i" | ||
$0 "$i" | ||
fi | ||
done | ||
|
||
# check pdf files (or recurse .pdf directories) | ||
for i in *.pdf | ||
do | ||
if [ -d "$i" ] | ||
then | ||
echo "Recursing into directory: $i" | ||
$0 "$i" | ||
fi | ||
if [ -f "$i" ] | ||
then | ||
echo "Checking: $i" | ||
/usr/bin/pdfinfo "$i" >/dev/null 2>&1 | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Invalid PDF file: $i" | ||
mv "$i" "invalid-pdf-$i" | ||
fi | ||
fi | ||
if [ -d "$i" ] | ||
then | ||
# echo "Recursing into: $i" | ||
$0 "$i" | ||
fi | ||
if [ -f "$i" ] | ||
then | ||
# echo "Checking: $i" | ||
/usr/bin/pdfinfo "$i" >/dev/null 2>&1 | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Invalid PDF file: $i !!!" | ||
mv "$i" "$i.bad" | ||
fi | ||
fi | ||
done | ||
|
||
sync | ||
|
||
echo -e "\nDone.\n" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.