Advertisement
v1ral_ITS

test2

Nov 11th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.61 KB | None | 0 0
  1. #!/bin/sh
  2. #//+ ITS_ function to easily check the,
  3. #// operating systems presense of any needed package.
  4.  
  5. #/#/ Define any tools needed here seperated only by a "\:space:"\
  6. needed_tool=' yad pastebin cat echo curl '
  7.  
  8. #//* Begin System Tool Search
  9. require_tools ()
  10. {
  11.     local NOT_AVAIL=""
  12.     for TOOL in $needed_tool; do
  13.         if [ "`which $TOOL`" 2> /dev/null == "" ]; then
  14.     NOT_AVAIL="$NOT_AVAIL $TOOL";
  15.     fi
  16.     done
  17.     if [[ "$NOT_AVAIL" != "" ]]; then
  18.     echo "ERROR: The following required tool(s) cannot be found: $NOT_AVAIL"
  19.         exit 3
  20.     fi
  21. }
  22.  
  23. # Check file system tools before we start
  24. require_tools || exit 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement