mirror of
https://github.com/sigmasternchen/ThroughYou
synced 2025-03-14 23:58:56 +00:00
add dependency script
This commit is contained in:
parent
bc2d252ce2
commit
a3c438273f
2 changed files with 55 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 ThroughYou."
|
||||
echo
|
||||
|
||||
sort depends.list Pensieve/depends.list | uniq | while read d; do
|
||||
check $d
|
||||
done
|
||||
echo
|
||||
|
||||
result
|
||||
if test $? = 0; then
|
||||
echo "Overall success!"
|
||||
exit 0
|
||||
else
|
||||
echo "Overfall failure!"
|
||||
exit 1
|
||||
fi
|
5
depends.list
Normal file
5
depends.list
Normal file
|
@ -0,0 +1,5 @@
|
|||
getopt
|
||||
grep
|
||||
awk
|
||||
cat
|
||||
wget
|
Loading…
Reference in a new issue