]> git.rmz.io Git - dotfiles.git/commitdiff
fixes permissions on Skaro
authorSamir Benmendil <samir.benmendil@gmail.com>
Mon, 7 Jan 2013 21:31:20 +0000 (22:31 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Mon, 7 Jan 2013 21:31:20 +0000 (22:31 +0100)
bin/fix-skaro-permissions [new file with mode: 0755]

diff --git a/bin/fix-skaro-permissions b/bin/fix-skaro-permissions
new file mode 100755 (executable)
index 0000000..294a91b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+dir="/mnt/Skaro"
+folders=(Documentaries eBooks Games "Install Discs" Movies "Movies [fr]" Music roms Series Standup)
+folders=( "${folders[@]/#/$dir/}" )
+
+sudo find "${folders[@]}" ! \( -user ramsi -a -group users \) -exec chown ramsi:users {} +
+find "${folders[@]}" -type f ! -perm 644 -exec chmod 0644 {} +
+find "${folders[@]}" -type d ! -perm 755 -exec chmod u=rwx,go=rx,a-s {} +