summaryrefslogtreecommitdiff
path: root/compile.sh
blob: a920ae2d66a3aad94063411826ddca150e575f96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#clean it out so I quit restarting after a failed compile. >.<
INSTALL_DIR="/home/segfault/"
rm segfault
echo '#!/bin/sh' > shell
echo '# this file is generated by compile.sh. do not edit directly' >> shell
echo 'cd "'`pwd`'"' >> shell
echo 'kill `pgrep -P 1 -f "tail -f ./files/cmd_in"`' >> shell
echo 'setuidgid segfault tail -f ./files/cmd_in | setuidgid segfault su -l segfault > ./files/cmd_out 2>&1' >> shell
chmod +x shell
echo '#define CHDIR "'`pwd`'"' > config.h

#if [ -e /usr/lib/libirc.so ]; then
# gcc -Wall -o segfault segfault.c -lirc
# rm -r /var/www/source/segfault/*
# cd /home/epoch/projects/c_/wargaming-libirc
# ./compile.sh
# cd /root/services/segfault
# cp * /var/www/source/segfault/
# mkdir /var/www/source/segfault/scripts
# cp scripts/* /var/www/source/segfault/scripts/
# cd /var/www/source/
# tar -czf segfault.tgz segfault

 mkdir $INSTALL_DIR/files
 mkfifo $INSTALL_DIR/files/cmd_in
 mkfifo $INSTALL_DIR/files/cmd_out
 cd libirc
 ./compile.sh
 cd ..
 gcc -Wall -o segfault segfault.c -lirc -Llibirc -Ilibirc

rm config.h