BE_reseau/tsock_texte
Nicolas Van Wambeke dc58e0e2d5 Initial Import
2016-06-13 23:17:19 +02:00

40 lines
589 B
Bash

#!/bin/bash
puits=false
sourc=false
protocol="tcp"
usage() { echo "Usage: $0 [-p|-s]" 1>&2; exit 1; }
while getopts "pst:" o; do
case "${o}" in
p)
puits=true
;;
s)
sourc=true
;;
*)
usage
;;
esac
done
if ([ "$puits" = true ] && [ "$sourc" = true ]) || ([ "$puits" = false ] && [ "$sourc" = false ]) ; then
usage
exit 1
fi
if [ "$puits" = true ]; then
cd build
./server
cd ..
fi
if [ "$sourc" = true ]; then
cd build
./client
cd ..
fi