mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
Mask log output
This commit is contained in:
parent
b37420cdd0
commit
83e7425e74
2 changed files with 10 additions and 5 deletions
2
dzgui.sh
2
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=2.8.0-rc.14
|
version=2.8.0-rc.15
|
||||||
|
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
|
|
@ -6,6 +6,7 @@ source $conf
|
||||||
aid=221100
|
aid=221100
|
||||||
steamcmd_user=steam
|
steamcmd_user=steam
|
||||||
workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
||||||
|
helpers_path="$HOME/.local/share/dzgui/helpers"
|
||||||
|
|
||||||
log(){
|
log(){
|
||||||
printf "$(tput setaf 3)[INFO]$(tput sgr0) %s\n" "$1"
|
printf "$(tput setaf 3)[INFO]$(tput sgr0) %s\n" "$1"
|
||||||
|
@ -160,7 +161,7 @@ check_user(){
|
||||||
generic_install(){
|
generic_install(){
|
||||||
fail "Unrecognized distro: $dist."
|
fail "Unrecognized distro: $dist."
|
||||||
log "Please report this upstream for whitelisting and attach your SCMD.log"
|
log "Please report this upstream for whitelisting and attach your SCMD.log"
|
||||||
log "Location: $HOME/.local/share/dzgui/helpers/SCMD.log"
|
log "Location: $helpers_path/SCMD.log"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
fedora_install(){
|
fedora_install(){
|
||||||
|
@ -286,7 +287,7 @@ return_to_dzg(){
|
||||||
fail "Errors occurred. Type any key to return to DZGUI and kick off manual install."
|
fail "Errors occurred. Type any key to return to DZGUI and kick off manual install."
|
||||||
read -n1 key
|
read -n1 key
|
||||||
case $key in
|
case $key in
|
||||||
*) exit 1 ;;
|
*) cleanup ;;
|
||||||
esac
|
esac
|
||||||
elif [[ $dist == "steamos" ]]; then
|
elif [[ $dist == "steamos" ]]; then
|
||||||
pass "All OK. Returning to DZGUI."
|
pass "All OK. Returning to DZGUI."
|
||||||
|
@ -294,7 +295,7 @@ return_to_dzg(){
|
||||||
printf "Returning in %i\r" "$i"
|
printf "Returning in %i\r" "$i"
|
||||||
sleep 1s
|
sleep 1s
|
||||||
done
|
done
|
||||||
exit 0
|
cleanup
|
||||||
else
|
else
|
||||||
$(cd $HOME/.local/share/dzgui/helpers; zenity --text-info --html --width=390 --height=452 --filename="d.html" 2>/dev/null)
|
$(cd $HOME/.local/share/dzgui/helpers; zenity --text-info --html --width=390 --height=452 --filename="d.html" 2>/dev/null)
|
||||||
return 0
|
return 0
|
||||||
|
@ -302,6 +303,9 @@ return_to_dzg(){
|
||||||
}
|
}
|
||||||
cleanup(){
|
cleanup(){
|
||||||
tput cnorm
|
tput cnorm
|
||||||
|
cp $helpers_path/SCMD.log $helpers_path/SCMD.log.bk
|
||||||
|
grep -v "Logging in user" $helpers_path/SCMD.log.bk > $helpers_path/SCMD.log
|
||||||
|
rm $helpers_path/SCMD.log.bk
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
abort(){
|
abort(){
|
||||||
|
@ -355,4 +359,5 @@ main(){
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
trap abort SIGINT
|
trap abort SIGINT
|
||||||
main | tee -a SCMD.log
|
main | tee -a $helpers_path/SCMD.log
|
||||||
|
cleanup
|
||||||
|
|
Loading…
Reference in a new issue