]> gitweb.fluxo.info Git - hydra.git/commitdiff
Ensure the media folder exist at sync-tpc
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 23:46:25 +0000 (20:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 23:46:25 +0000 (20:46 -0300)
share/hydractl/sync-tpc

index 09c4adc724dd51b7865da25ae833299c35d2c8c1..31a29aeebc80a9179da0d20f9d6187afe9028538 100755 (executable)
@@ -57,5 +57,14 @@ if [ -d "/etc/wicd" ]; then
   $SUDO cp -a /etc/wicd/wireless-settings.conf $DEST/etc/wicd/wireless-settings.conf
 fi
 
+# Ensure the media folder exist
+if [ ! -d "$MEDIA" ]; then
+  $SUDO mkdir -p $MEDIA
+
+  if [ "$USER" != 'root' ]; then
+    $SUDO chown $USER.$USER $MEDIA
+  fi
+fi
+
 # Sync media remotes
 hydractl sync-media-remotes $MEDIA