-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·56 lines (37 loc) · 755 Bytes
/
setup.sh
File metadata and controls
executable file
·56 lines (37 loc) · 755 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/env bash
set -eu
cd $(dirname $0)
SRC_DIR=$(pwd)
if [ -z ${TARGET_DIR+x} ] ; then
TARGET_DIR=$(echo $PATH | tr ":" "\n" | grep $HOME | head -n 1)
if [ `whoami` = "root" ] ; then
TARGET_DIR=/usr/bin
fi
fi
install () {
echo installing into $TARGET_DIR
cd $TARGET_DIR
cp $SRC_DIR/nscp.py nscp
cp $SRC_DIR/sshow.sh sshow
cp $SRC_DIR/nssh.py nssh
chmod +x nscp sshow nssh
}
uninstall () {
echo uninstalling from $TARGET_DIR
cd $TARGET_DIR
rm -f nscp sshow nssh
}
install_dev () {
echo linking source files into $TARGET_DIR
cd $TARGET_DIR
ln -s $SRC_DIR/nscp.py nscp
ln -s $SRC_DIR/sshow.sh sshow
ln -s $SRC_DIR/nssh.py nssh
chmod +x nscp sshow nssh
}
test () {
set -x
echo $TARGET_DIR
echo $SRC_DIR
}
"$@"