Skip to content
Snippets Groups Projects
run_handle_server.sh 757 B
Newer Older
#!/bin/sh

SRV_DIR=$1

# ### Copy configuration and empty database ###
if [ ! -e "${SRV_DIR}/config.dct" ] ; then
    cp -r /hs/templates/* "${SRV_DIR}"
fi

# ### Update configuration ###

# update config.dct
sed "s/HANDLE_SERVER_IPV4_ADDRESS/${HANDLE_SERVER_IPV4_ADDRESS}/g" /hs/templates/config.dct > "$SRV_DIR/config.dct"

# update siteinfo.json
sed "s/HANDLE_SERVER_IPV4_ADDRESS/${HANDLE_SERVER_IPV4_ADDRESS}/g" /hs/templates/siteinfo.json > "$SRV_DIR/siteinfo.json"


# ### Configure private handle network ###
# See Technical Manual, Section 10.1
# https://hdl.handle.net/20.1000/113
mkdir -p /root/.handle
cp "$SRV_DIR/siteinfo.json" /root/.handle/resolver_site
echo '*' > /root/.handle/local_nas

# actually run the server
bin/hdl-server "$SRV_DIR"