#!/bin/sh # Copyright (c) 2018-2019 TildeLinux Maintainers # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Email: tildelinux@tildeverse.org mounts_file="$HOME/.ssh/mounts" get_locations() { if ! grep -q "SSHFS Mount " "$mounts_file" then printf "\\n" printf " \\n" printf " %s/.local/bin/sshfs_gui.sh\\n" "$HOME" printf " \\n" printf "\\n" else while read -r line do location_path="" if printf "%s" "$line" | grep -q "SSHFS Mount " then location_path=$(printf "%s" "$line" | rev | cut -f 2 -d ' ' | rev) location_name=$(printf "%s" "$line" | rev | cut -f 1-2 -d ' ' | rev) printf "\\n" "$location_name" printf " \\n" printf " thunar %s\\n" "$location_path" printf " \\n" printf "\\n" fi done < "$mounts_file" printf "\\n" printf "\\n" printf " \\n" printf " %s/.local/bin/sshfs_gui.sh\\n" "$HOME" printf " \\n" printf "\\n" fi } printf "\\n" printf "\\n" printf " \\n" printf " thunar\\n" printf " \\n" printf "\\n" printf "\\n" get_locations printf "\\n"