Skip to content
Permalink
Browse files

Add option to disable TUI

dont allow updater to use dialog to config autoinstaller during install
  • Loading branch information...
TotallyNotElite committed Sep 30, 2019
1 parent 60b3dc4 commit a4f3ef713091d0d8bd4d52cbd2acb8cbd99f567e
Showing with 16 additions and 10 deletions.
  1. +1 −1 attach
  2. +1 −1 attach-gdb
  3. +1 −1 attach-libnamed.sh
  4. +1 −1 install-all
  5. +12 −6 scripts/updater
2 attach
@@ -3,7 +3,7 @@
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"

$RUNCMD bash ./scripts/updater --autoupdater
$RUNCMD bash ./scripts/updater true

line=$(pgrep -u $RUNUSER hl2_linux)
arr=($line)
@@ -3,7 +3,7 @@
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"

$RUNCMD bash ./scripts/updater --autoupdater
$RUNCMD bash ./scripts/updater true

line=$(pgrep -u $RUNUSER hl2_linux)
arr=($line)
@@ -6,7 +6,7 @@
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"

$RUNCMD bash ./scripts/updater --autoupdater
$RUNCMD bash ./scripts/updater true

line=$(pgrep -u $(logname) hl2_linux)
arr=($line)
@@ -28,4 +28,4 @@ $RUNUSER bash -c ". ./scripts/config.shlib; cfg_write ./scripts/updater-preferen
# Build cathook
#

$RUNUSER ./update
$RUNUSER ./update false true
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# $1 Auto updater
# $2 Disable TUI

set -e

configfile="./scripts/updater-preferences"
@@ -23,18 +26,21 @@ echo $$ > ${LOCKFILE}
./scripts/dependencycheck

# Run migrations
./scripts/migrations || exit 0
./scripts/migrations "$@" || exit 0

. ./scripts/config.shlib

tui=true
if [ ! -x "$(command -v dialog)" ]; then
if [ ! -t 0 ]; then
tui=false
echo -e "\033[1;31mTerminal UI NOT supported! Install \"dialog\"! \033[0m"
fi
if [ ! -t 0 ]; then
if [ "$2" == "true" ]; then
tui=false
fi
if [ ! -x "$(command -v dialog)" ] && [ "$tui" == true ]; then
tui=false
echo -e "\033[1;31mTerminal UI NOT supported! Install \"dialog\"! \033[0m"
fi

exists=true
cfg_haskey $configfile autoupdater || exists=false
@@ -53,7 +59,7 @@ fi

exists=true
cfg_haskey $configfile autoupdater || exists=false
if [ "$1" == "--autoupdater" ]; then
if [ "$1" == "true" ]; then
if [ $exists == false ] || [ "$(cfg_read $configfile autoupdater)" == false ]; then
exit 0;
fi
@@ -84,7 +90,7 @@ function performupdate() {
fi

# Run migrations
./scripts/migrations || exit 0
./scripts/migrations "$@" || exit 0

proccount=$(grep -c '^processor' /proc/cpuinfo)
if [ "$AUTOUPDATER" == true ]; then

0 comments on commit a4f3ef7

Please sign in to comment.
You can’t perform that action at this time.