This commit is contained in:
Bob Mottram 2017-03-05 21:05:03 +00:00
parent 42dbd06431
commit 00aceb2946
1 changed files with 13 additions and 13 deletions

View File

@ -283,7 +283,7 @@ function create_tahoelafs_daemon {
daemon_name=$1 daemon_name=$1
TAHOELAFS_DAEMON_FILE=/etc/systemd/system/tahoelafs_${daemon_name}.service TAHOELAFS_DAEMON_FILE=/etc/systemd/system/tahoelafs_${daemon_name}.service
echo "$TAHOELAFS_DAEMON_FILE" echo "Creating daemon: $TAHOELAFS_DAEMON_FILE"
echo '[Unit]' > $TAHOELAFS_DAEMON_FILE echo '[Unit]' > $TAHOELAFS_DAEMON_FILE
echo "Description=Tahoe-LAFS ${daemon_name}" >> $TAHOELAFS_DAEMON_FILE echo "Description=Tahoe-LAFS ${daemon_name}" >> $TAHOELAFS_DAEMON_FILE
@ -348,16 +348,6 @@ function install_tahoelafs {
exit 62831 exit 62831
fi fi
if [ ! -d /home/tahoelafs/storage ]; then
mkdir /home/tahoelafs/storage
fi
create_tahoelafs_storage_node /home/tahoelafs/storage "$(get_tahoelafs_introducer)"
TAHOELAFS_STORAGE_CONFIG=/home/tahoelafs/storage/tahoe.cfg
if [ ! -f $TAHOELAFS_STORAGE_CONFIG ]; then
echo $'Unable to create storage node'
exit 782523
fi
# create an onion address # create an onion address
TAHOELAFS_ONION_HOSTNAME=$(add_onion_service tahoelafs ${TAHOELAFS_PORT} ${TAHOELAFS_ONION_PORT}) TAHOELAFS_ONION_HOSTNAME=$(add_onion_service tahoelafs ${TAHOELAFS_PORT} ${TAHOELAFS_ONION_PORT})
@ -369,11 +359,21 @@ function install_tahoelafs {
echo $'Introducer file not found' echo $'Introducer file not found'
exit 9654845 exit 9654845
fi fi
create_tahoelafs_daemon introducer create_tahoelafs_daemon "introducer"
# start the storage node # start the storage node
if [ ! -d /home/tahoelafs/storage ]; then
mkdir /home/tahoelafs/storage
fi
create_tahoelafs_storage_node /home/tahoelafs/storage "$(get_tahoelafs_introducer)"
TAHOELAFS_STORAGE_CONFIG=/home/tahoelafs/storage/tahoe.cfg
if [ ! -f $TAHOELAFS_STORAGE_CONFIG ]; then
echo $'Unable to create storage node'
exit 782523
fi
su -c '/home/tahoelafs/tahoelafs/venv/bin/python2 /home/tahoelafs/tahoelafs/venv/bin/tahoe start /home/tahoelafs/storage' - tahoelafs su -c '/home/tahoelafs/tahoelafs/venv/bin/python2 /home/tahoelafs/tahoelafs/venv/bin/tahoe start /home/tahoelafs/storage' - tahoelafs
create_tahoelafs_daemon storage create_tahoelafs_daemon "storage"
set_completion_param "tahoelafs commit" "$TAHOELAFS_COMMIT" set_completion_param "tahoelafs commit" "$TAHOELAFS_COMMIT"