mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 05:13:19 -07:00
Use numeric ids instead of names for user/group in installer. Fixes #217
This commit is contained in:
parent
293e6d5ecb
commit
180fc1687f
1 changed files with 3 additions and 3 deletions
|
@ -114,12 +114,12 @@ install_plexupdate() {
|
||||||
echo -n "'$FULL_PATH' doesn't exist, attempting to create... "
|
echo -n "'$FULL_PATH' doesn't exist, attempting to create... "
|
||||||
if ! mkdir -p "$FULL_PATH" 2>/dev/null; then
|
if ! mkdir -p "$FULL_PATH" 2>/dev/null; then
|
||||||
sudo mkdir -p "$FULL_PATH" || abort "failed, cannot continue"
|
sudo mkdir -p "$FULL_PATH" || abort "failed, cannot continue"
|
||||||
sudo chown $(id -un):$(id -gn) "$FULL_PATH" || abort "failed, cannot continue"
|
sudo chown $(id -u):$(id -g) "$FULL_PATH" || abort "failed, cannot continue"
|
||||||
fi
|
fi
|
||||||
echo "done"
|
echo "done"
|
||||||
elif [ ! -w "$FULL_PATH" ]; then
|
elif [ ! -w "$FULL_PATH" ]; then
|
||||||
echo -n "'$FULL_PATH' exists, but you don't have permission to write to it. Changing owner... "
|
echo -n "'$FULL_PATH' exists, but you don't have permission to write to it. Changing owner... "
|
||||||
sudo chown $(id -un):$(id -gn) "$FULL_PATH" || abort "failed, cannot continue"
|
sudo chown $(id -u):$(id -g) "$FULL_PATH" || abort "failed, cannot continue"
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ save_config() {
|
||||||
sudo tee "$2" > /dev/null < "$CONFIGTEMP"
|
sudo tee "$2" > /dev/null < "$CONFIGTEMP"
|
||||||
sudo chmod 640 "$2"
|
sudo chmod 640 "$2"
|
||||||
# only root can modify the config, but the user can still read it
|
# only root can modify the config, but the user can still read it
|
||||||
sudo chown 0:$(id -gn) "$2"
|
sudo chown 0:$(id -g) "$2"
|
||||||
rm "$CONFIGTEMP"
|
rm "$CONFIGTEMP"
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue