#!/bin/bash

echo
echo
echo
echo "Creating UrbanTerror Slackware Package..."
echo "Please wait..."
echo

(
    cd /opt/urbanterror_autobuilder || exit 1
    rm *.t?z
    bash urbanterror.SlackBuild --cleanup
)

echo
echo
echo
echo "Package created!!"
echo
echo "Now I will install it"
echo "Please wait..."
echo

(
    cd /opt/urbanterror_autobuilder || exit 1
    if [ -e *.t?z ]; then
        upgradepkg --install-new *.t?z
        echo
        echo
        echo
        echo "Package installed!!"
    else
        echo
        echo
        echo
        echo "Error creating package!!!"
    fi
)

echo

