Make `containersync` script usable again when it already runs as root
This commit is contained in:
parent
e8dfb41e32
commit
d8d4e8ca94
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
[ "$(whoami)" == root ] && sudo= || sudo=sudo
|
||||||
for config_file in {/cfg/,}{makepkg,pacman}.conf; do
|
for config_file in {/cfg/,}{makepkg,pacman}.conf; do
|
||||||
[[ -f $config_file ]] && sudo cp --target-directory=/etc "$config_file"
|
[[ -f $config_file ]] && $sudo cp --target-directory=/etc "$config_file"
|
||||||
done
|
done
|
||||||
[[ -f PKGBUILD ]] && source PKGBUILD
|
[[ -f PKGBUILD ]] && source PKGBUILD
|
||||||
sudo pacman -Syu --noconfirm --needed "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}"
|
$sudo pacman -Syu --noconfirm --needed "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}"
|
||||||
|
|
Loading…
Reference in New Issue