mirror of
https://github.com/zardus/ctf-tools
synced 2024-12-14 15:02:33 +00:00
fixed weird indentation fails and added 'set -eu -o pipefail' at the top of the script
This commit is contained in:
parent
6dd094a8a9
commit
98c76cefde
1 changed files with 48 additions and 50 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash
|
||||||
# set -evx
|
set -eu -o pipefail
|
||||||
|
# set -x
|
||||||
|
|
||||||
function usage()
|
function usage()
|
||||||
{
|
{
|
||||||
|
@ -47,8 +48,7 @@ function base_build_setup_ubuntu()
|
||||||
PACKAGE_COUNT=$(echo $PACKAGE_REQS | tr ' ' '\n' | wc -l)
|
PACKAGE_COUNT=$(echo $PACKAGE_REQS | tr ' ' '\n' | wc -l)
|
||||||
if [ $(dpkg -l $PACKAGE_REQS | grep "^ii" | wc -l) -ne $PACKAGE_COUNT ]
|
if [ $(dpkg -l $PACKAGE_REQS | grep "^ii" | wc -l) -ne $PACKAGE_COUNT ]
|
||||||
then
|
then
|
||||||
if [ "$ALLOW_SUDO" -eq 1 ]
|
if [ "$ALLOW_SUDO" -eq 1 ]; then
|
||||||
then
|
|
||||||
sudo apt-get -y install $PACKAGE_REQS
|
sudo apt-get -y install $PACKAGE_REQS
|
||||||
else
|
else
|
||||||
TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS"
|
TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS"
|
||||||
|
@ -78,10 +78,8 @@ function base_build_setup_arch()
|
||||||
TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS"
|
TOOL=SETUP tool_log "Please install the following packages: $PACKAGE_REQS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if ! grep "^\[multilib\]$" /etc/pacman.conf >/dev/null; then
|
if ! grep "^\[multilib\]$" /etc/pacman.conf >/dev/null; then
|
||||||
if [ "$ALLOW_SUDO" -eq 1 ]
|
if [ "$ALLOW_SUDO" -eq 1 ]; then
|
||||||
then
|
|
||||||
sudo sh -c 'cat >> /etc/pacman.conf' <<EOF
|
sudo sh -c 'cat >> /etc/pacman.conf' <<EOF
|
||||||
|
|
||||||
[multilib]
|
[multilib]
|
||||||
|
|
Loading…
Reference in a new issue