Check we're in a tty

This commit is contained in:
Alexandre Aubin 2018-04-26 18:35:52 +02:00
parent 38122c6e93
commit 8f731112b8
2 changed files with 14 additions and 0 deletions

7
daily-build Normal file → Executable file
View file

@ -11,6 +11,13 @@ source /home/vinaigrette/config/config
function main()
{
if [[ "$(tty)" == "not a tty" ]]
then
echo "You aint in a tty (are you in a 'lxc exec' ?)"
echo "The script can't run because pbuilder won't be happy :|"
exit
fi
for PACKAGE in $PACKAGES;
do

View file

@ -137,6 +137,13 @@ function main()
validate_arguments
if [[ "$(tty)" == "not a tty" ]]
then
echo "You aint in a tty (are you in a 'lxc exec' ?)"
echo "The script can't run because pbuilder won't be happy :|"
exit
fi
# Sum up configuration
echo "########################################################"
echo "# Building $PROJECT $BRANCH release - $VERSION version "