mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00

2. added SCTP protocol and schema support 3. added set of NAS models support (Asustor, ReadyNAS, Drobo, QNAP, WD, Synology, Terramaster) 4. moved to fc00::/7 private segment 5. added Windows, MacOS and Linux UI for peers edit and current status
40 lines
818 B
Bash
40 lines
818 B
Bash
#!/usr/bin/env sh
|
|
|
|
tmpdir="/tmp/DroboApps/mesh"
|
|
errorfile="${tmpdir}/error.txt"
|
|
base_dir="/mnt/DroboFS/Shares/DroboApps/mesh"
|
|
config_dir="$base_dir/config"
|
|
config_file="$config_dir/mesh.conf"
|
|
prog_dir="$(dirname "$(realpath "${0}")")"
|
|
|
|
|
|
_install() {
|
|
if [ ! -f "${errorfile}" ]
|
|
then
|
|
mkdir -p "${tmpdir}"
|
|
if [ ! -f "$config_file" ]; then
|
|
echo 3 > "${errorfile}"
|
|
fi
|
|
fi
|
|
ln -s $base_dir/var/log/mesh.log $base_dir/www/log
|
|
# install apache 2.x
|
|
/usr/bin/DroboApps.sh install_version apache 2
|
|
}
|
|
|
|
_uninstall() {
|
|
pid=`pidof -s mesh`
|
|
if [ -z "$pid" ]; then
|
|
echo "mesh was not running"
|
|
else
|
|
kill "$pid"
|
|
fi
|
|
}
|
|
|
|
_update() {
|
|
/bin/sh "${prog_dir}/service.sh" stop
|
|
|
|
cd "$base_dir"
|
|
rm -rf $(ls | grep -v 'host_uid.txt\|var\|config')
|
|
|
|
echo 'update successful' > "${prog_dir}/update.log"
|
|
}
|