mirror of
https://github.com/sigmasternchen/Pensieve
synced 2025-03-15 07:58:54 +00:00
add dependency script
This commit is contained in:
parent
3b2b66e5f7
commit
9e72d00f5d
2 changed files with 64 additions and 0 deletions
50
dependencies.sh
Executable file
50
dependencies.sh
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
|
||||
TAB=20
|
||||
|
||||
sumfile=/dev/shm/$$.sum
|
||||
|
||||
echo 0 > $sumfile
|
||||
|
||||
increment() {
|
||||
v=$(cat $sumfile)
|
||||
echo $(($v + 1)) > $sumfile
|
||||
}
|
||||
|
||||
result() {
|
||||
return $(cat $sumfile)
|
||||
}
|
||||
|
||||
check() {
|
||||
str="Checking $1"
|
||||
echo -n "$str"
|
||||
|
||||
for i in $(seq ${#str} 1 $TAB); do
|
||||
echo -n " "
|
||||
done
|
||||
|
||||
f=$(which $1)
|
||||
if test $? != 0; then
|
||||
echo -e "[\033[31mFAILURE\033[0m]"
|
||||
increment
|
||||
else
|
||||
echo -e "[\033[32mSUCCESS\033[0m] ($f)"
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Checking dependancies for pensieve."
|
||||
echo
|
||||
|
||||
while read d; do
|
||||
check $d
|
||||
done < depends.list
|
||||
echo
|
||||
|
||||
result
|
||||
if test $? = 0; then
|
||||
echo "Overall success!"
|
||||
exit 0
|
||||
else
|
||||
echo "Overfall failure!"
|
||||
exit 1
|
||||
fi
|
14
depends.list
Normal file
14
depends.list
Normal file
|
@ -0,0 +1,14 @@
|
|||
getopt
|
||||
gpg
|
||||
grep
|
||||
sed
|
||||
stat
|
||||
editor
|
||||
pager
|
||||
wc
|
||||
sleep
|
||||
head
|
||||
tail
|
||||
date
|
||||
cat
|
||||
awk
|
Loading…
Reference in a new issue