-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·41 lines (31 loc) · 804 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·41 lines (31 loc) · 804 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
40
41
#!/bin/sh
if [ $# -lt 2 ] ; then
echo "Usage: $0 target_dir executable_file"
exit 1
fi
prefix=$1
exe=$2
config=dadder.config
badip=badip.txt
blacklist=blacklist.txt
if [ ! -d "$prefix" ] ; then
echo "$prefix does not exist, try to make it... "
if ! mkdir $prefix ; then
echo "Unable to mkdir of $prefix."
exit 2
fi
fi
echo "Now copy executable files and configuration files..."
cp $exe $prefix
if [ ! -e "$prefix/$config" ] ; then
cp ./config/$config $prefix
fi
if [ ! -e "$prefix/blacklist.txt" ] ; then
cp ./config/$blacklist $prefix
fi
if [ ! -e "$prefix/$badip" ] ; then
cp ./config/$badip $prefix
fi
echo "Done."
echo "Now, eddit configuration file: $prefix/$config , and then start the process by:"
echo "$prefix/$exe -c $prefix/$config"