diff --git a/history_scripts/visit_migrated_documents.sh b/history_scripts/visit_migrated_documents.sh index cf276f6aed4d1d8e7c103a7e1c555a61c50623c6..87960b287c2efd88bb0652d56b1af8925181b7e0 100755 --- a/history_scripts/visit_migrated_documents.sh +++ b/history_scripts/visit_migrated_documents.sh @@ -1,11 +1,13 @@ -#!/bin/bash +#!/usr/bin/env bash +open_command=open +if [[ $(command -v xdg-oasasdpen) ]]; +then + open_command=xdg-open +fi script_directory=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) url_file=$script_directory/hedgedoc_documents_to_visit.url -echo "Please specify which browser should be used to access the newly created documents" -echo "This browser needs to have an active and logged-in HedgeDoc session." -echo "ATTENTION: your input will be evaluated as part of a shell script" -echo "ATTENTION: your input string needs to be present on your path (e.g. firefox or google-chrome)" -echo "Specify the browser:" -read browser readarray -t url_array < $url_file -echo "${url_array[@]}" | xargs -n50 $browser \ No newline at end of file +for i in "${url_array[@]}" +do + $($open_command $i) +done \ No newline at end of file