Skip to content
Snippets Groups Projects
Commit ff95d79d authored by Bob Mottram's avatar Bob Mottram
Browse files

Check that file exists

parent 88f0c36f
No related branches found
No related tags found
No related merge requests found
......@@ -107,10 +107,12 @@ function add_onion_service {
onion_address=$(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname)
# Record the domain in the completion file
if ! grep "${onion_service_name} onion domain" $COMPLETION_FILE; then
echo "${onion_service_name} onion domain:${onion_address}" >> $COMPLETION_FILE
else
sed -i "s|${onion_service_name} onion domain.*|${onion_service_name} onion domain:${onion_address}|g" $COMPLETION_FILE
if [ -f $COMPLETION_FILE ]; then
if ! grep "${onion_service_name} onion domain" $COMPLETION_FILE; then
echo "${onion_service_name} onion domain:${onion_address}" >> $COMPLETION_FILE
else
sed -i "s|${onion_service_name} onion domain.*|${onion_service_name} onion domain:${onion_address}|g" $COMPLETION_FILE
fi
fi
echo $onion_address
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment