-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcommon.sh
More file actions
61 lines (52 loc) · 1.11 KB
/
Copy pathcommon.sh
File metadata and controls
61 lines (52 loc) · 1.11 KB
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
57
58
59
60
61
#!/bin/sh
INST_PATH=/mnt/HD/HD_a2/Nas_Prog/boot4shell
daemon=$INST_PATH/bin/boot4shell
pidfile=$INST_PATH/pid
config_dir=/mnt/HD/HD_a2/Nas_Prog/boot4shell
config_file=$config_dir/boot4shell.config
preinst_sh() {
mv $config_file /tmp
}
install_sh() {
path_src=$1
path_des=$2
rm -rf $path_des/boot4shell
mv -f $path_src $path_des
}
remove_sh() {
killall -q boot4shellDaemon
killall -q boot4shell
sleep 1
LOG_SYMLINK=/var/log/boot4shell.log
[ -L $LOG_SYMLINK ] && rm -f $LOG_SYMLINK
path=$1
rm -f /var/www/boot4shell >/dev/null
rm -rf $path
}
stop_sh() {
$daemon -K -P $pidfile
}
init_sh() {
if [ -f /tmp/boot4shell.config ]; then
mv /tmp/boot4shell.config $config_dir
fi
}
start_sh() {
ln -sf $INST_PATH/ui /var/www/boot4shell
smb_conf_file="/etc/samba/smb.conf"
if [ ! -f $config_file ]; then
mkdir -p $config_dir
touch $config_file
fi
$daemon -D -P $pidfile \
-c "$config_dir" \
"SmbConfFile=$smb_conf_file" \
"AppRoot=$INST_PATH" \
"WebUIPort=17017" \
"WebUIAddress=0.0.0.0" \
"WebUIWWWRoot=${INST_PATH}/www" \
"CreateLogSymlink=false"
}
clean_sh() {
rm -f /var/www/boot4shell >/dev/null
}