chore: Use 'install' instead of 'cp, chmod, mv,...'

This commit is contained in:
Serge Guzik 2019-02-15 11:32:49 +02:00
parent 19ebc90cc5
commit 4e87231b59

11
install
View File

@ -59,11 +59,12 @@ function install() {
echo "Error: Failed to download $name" >&2
fail
fi
echo "Installing $LOCATION/$name..."
chmod 755 "$temp_location" && \
sudo chown root:root "$temp_location" && \
sudo mkdir -p "$LOCATION" && \
sudo mv "$temp_location" "$LOCATION/$name"
echo "Creating $LOCATION/$name..."
sudo install -D \
--mode=755 \
--owner=root \
--group=root \
"$temp_location" "$LOCATION"
if [[ $? != 0 ]]; then
echo "Error: Failed to install $name" >&2
fail