Skip to content

Commit 49731df

Browse files
authored
Merge pull request #3971 from joolswills/usbromservice_group
usbromservice - Add group to usbmount scripts
2 parents 18c2b43 + ef15622 commit 49731df

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

scriptmodules/supplementary/usbromservice.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function install_scripts_usbromservice() {
4646
local dest
4747
for file in "$md_data/"*; do
4848
dest="/etc/usbmount/mount.d/${file##*/}"
49-
sed "s/USERTOBECHOSEN/$__user/g" "$file" >"$dest"
49+
sed -e "s/USER/$__user/g" -e "s/GROUP/$__group/g" "$file" >"$dest"
5050
chmod +x "$dest"
5151
done
5252
}

scriptmodules/supplementary/usbromservice/01_retropie_copyroms

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#
1010

1111
## config / defaults
12-
user="USERTOBECHOSEN"
12+
user="USER"
13+
group="GROUP"
1314

1415
home="$(eval echo ~$user)"
1516
rootdir="/opt/retropie"
@@ -68,7 +69,7 @@ find "$retropie_path/roms" -mindepth 1 -maxdepth 1 -type d -printf "$usb_path/ro
6869
for dir in roms BIOS; do
6970
log info "Syncing $dir ..."
7071
log_cmd rsync -rtu --exclude '._*' --max-delete=-1 "$usb_path/$dir" "$retropie_path/"
71-
chown -R $user:$user "$retropie_path/$dir"
72+
chown -R "$user":"$group" "$retropie_path/$dir"
7273
done
7374

7475
log info "Syncing configs ..."
@@ -85,7 +86,7 @@ for from in $(find "$usb_path_to_rp/" -mindepth 1 -maxdepth 1); do
8586
to=${path_mapping[$from_bn]}
8687
if [[ -n "$to" ]]; then
8788
log_cmd rsync -rtu --exclude '._*' --max-delete=-1 "$from/" "$to/"
88-
chown -R $user:$user "$to"
89+
chown -R "$user":"$group" "$to"
8990
fi
9091
done
9192

scriptmodules/supplementary/usbromservice/10_retropie_mount

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111

1212
## config / defaults
13-
user="USERTOBECHOSEN"
13+
user="USER"
1414

1515
home="$(eval echo ~$user)"
1616
retropie_path="$home/RetroPie"

0 commit comments

Comments
 (0)