aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaire Robinson <claire@mageia.org>2016-03-12 17:28:05 +0000
committerClaire Robinson <claire@mageia.org>2016-03-12 17:28:05 +0000
commit974184d3189f75f270217c166683e3e6f5400328 (patch)
tree09e2ca83123009b13cf6e4753aeb36afe66afbb6
parent6cba3fb887227283000ba6c1d88919a2aa31865d (diff)
Add missing package check, thanks barjacHEADmaster
-rw-r--r--dorsync11
1 files changed, 11 insertions, 0 deletions
diff --git a/dorsync b/dorsync
index 24ab526..a6b7721 100644
--- a/dorsync
+++ b/dorsync
@@ -41,6 +41,17 @@ bold='\e[01m'
endcolour='\e[0m'
rsyncargs=()
rsyncargs+=" -avHP"
+
+# Check required packages are installed
+deps=(coreutils udisks sed grep rsync)
+for dep in ${deps[@]}; do
+ if ! rpm --quiet -q $dep; then
+ echo "You need to install $dep to run this program"
+ baddep=1
+ fi
+done
+[[ ${#baddep} > 0 ]] && exit 1
+
if [[ -e dorsync.skip ]]; then
while read line; do
rsyncargs+=" --exclude=$line"