summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-03-11 14:41:01 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-03-11 14:41:01 -0400
commitf6b3febf72b2c3390304434ba63f6a6e803d3c2f (patch)
tree6956c172066a0350f37c58ea0b58e91c587c14f3
parent7b3912e694f5e69ad1833f971413faaf6acf28af (diff)
permissions fixes
-rw-r--r--larbs.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/larbs.sh b/larbs.sh
index cd6deff..f0f1acf 100644
--- a/larbs.sh
+++ b/larbs.sh
@@ -45,7 +45,7 @@ selectdotfiles() { \
getuserandpass() { \
# Prompts user for new username an password.
name=$(dialog --inputbox "First, please enter a name for the user account." 10 60 3>&1 1>&2 2>&3 3>&1) || exit
- repodir="/home/$name/.local/src"; mkdir -p "$repodir"
+ repodir="/home/$name/.local/src"; mkdir -p "$repodir"; chown -R "$name:wheel" "$repodir"
while ! echo "$name" | grep "^[a-z_][a-z0-9_-]*$" >/dev/null 2>&1; do
name=$(dialog --no-cancel --inputbox "Username not valid. Give a username beginning with a letter, with only lowercase letters, - or _." 10 60 3>&1 1>&2 2>&3 3>&1)
done
@@ -103,7 +103,7 @@ gitmakeinstall() {
progname="$(basename "$1")"
dir="$repodir/$progname"
dialog --title "LARBS Installation" --infobox "Installing \`$progname\` ($n of $total) via \`git\` and \`make\`. $(basename "$1") $2" 5 70
- git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return ; git pull --force origin master;}
+ sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return ; sudo -u "$name" git pull --force origin master;}
cd "$dir" || exit
make >/dev/null 2>&1
make install >/dev/null 2>&1
@@ -140,10 +140,10 @@ putgitrepo() { # Downloads a gitrepo $1 and places the files in $2 only overwrit
dialog --infobox "Downloading and installing config files..." 4 60
[ -z "$3" ] && branch="master" || branch="$repobranch"
dir=$(mktemp -d)
- [ ! -d "$2" ] && mkdir -p "$2" && chown -R "$name:wheel" "$2"
- chown -R "$name:wheel" "$dir"
- sudo -u "$name" git clone -b "$branch" --depth 1 "$1" "$dir/gitrepo" >/dev/null 2>&1
- sudo -u "$name" cp -rfT "$dir/gitrepo" "$2"
+ [ ! -d "$2" ] && mkdir -p "$2"
+ chown -R "$name:wheel" "$dir" "$2"
+ sudo -u "$name" git clone -b "$branch" --depth 1 "$1" "$dir" >/dev/null 2>&1
+ sudo -u "$name" cp -rfT "$dir" "$2"
}
systembeepoff() { dialog --infobox "Getting rid of that retarded error beep sound..." 10 50