Fixed gui askpass, added linked folders in menu
This commit is contained in:
parent
1634f32e98
commit
3d8d6b1aee
|
@ -22,6 +22,7 @@ Part of TildeLinux.
|
||||||
- Code cleanup
|
- Code cleanup
|
||||||
- Move shared functions into separate files
|
- Move shared functions into separate files
|
||||||
- Error handling for file creation
|
- Error handling for file creation
|
||||||
|
- Alert user if (local) directory they are trying to link to already contains a link
|
||||||
- The exit and cancel buttons should do the same thing
|
- The exit and cancel buttons should do the same thing
|
||||||
|
|
||||||
### ChangeLog
|
### ChangeLog
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
#
|
#
|
||||||
# Email: tildelinux@tildeverse.org
|
# Email: tildelinux@tildeverse.org
|
||||||
|
|
||||||
ssh_config_file="$HOME/.ssh/config"
|
mounts_file="$HOME/.ssh/mounts"
|
||||||
|
|
||||||
get_locations() {
|
get_locations() {
|
||||||
if ! grep -q "SSHFS Mount " "$ssh_config_file"
|
if ! grep -q "SSHFS Mount " "$mounts_file"
|
||||||
then
|
then
|
||||||
printf "<item label=\"Configure Locations...\">\\n"
|
printf "<item label=\"Configure Locations...\">\\n"
|
||||||
printf " <action name=\"Execute\">\\n"
|
printf " <action name=\"Execute\">\\n"
|
||||||
|
@ -41,7 +41,13 @@ get_locations() {
|
||||||
printf " </action>\\n"
|
printf " </action>\\n"
|
||||||
printf "</item>\\n"
|
printf "</item>\\n"
|
||||||
fi
|
fi
|
||||||
done < "$ssh_config_file"
|
done < "$mounts_file"
|
||||||
|
printf "<separator/>\\n"
|
||||||
|
printf "<item label=\"Configure More Locations...\">\\n"
|
||||||
|
printf " <action name=\"Execute\">\\n"
|
||||||
|
printf " <command>%s/.local/bin/sshfs_gui.sh</command>\\n" "$HOME"
|
||||||
|
printf " </action>\\n"
|
||||||
|
printf "</item>\\n"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
#
|
#
|
||||||
# Email: tildelinux@tildeverse.org
|
# Email: tildelinux@tildeverse.org
|
||||||
|
|
||||||
|
export SSH_ASKPASS="/usr/lib/ssh/x11-ssh-askpass"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
eval "$(xdotool getmouselocation --shell)"
|
eval "$(xdotool getmouselocation --shell)"
|
||||||
mouse_x=$X
|
mouse_x=$X
|
||||||
mouse_y=$Y
|
mouse_y=$Y
|
||||||
|
@ -189,7 +189,7 @@ configure_server() {
|
||||||
info_pid=$(( $! + 2 )) # yikes, is this safe?
|
info_pid=$(( $! + 2 )) # yikes, is this safe?
|
||||||
printf "%s\\n" "$ssh_temp_config"
|
printf "%s\\n" "$ssh_temp_config"
|
||||||
printf "%s\\n" "$server_address"
|
printf "%s\\n" "$server_address"
|
||||||
if ssh -qF "$ssh_temp_config" "$server_name" exit
|
if setsid -w ssh -qF "$ssh_temp_config" "$server_name" exit
|
||||||
then
|
then
|
||||||
kill $info_pid
|
kill $info_pid
|
||||||
succ_box "Login success!\\nAccount for ${server_address} created!"
|
succ_box "Login success!\\nAccount for ${server_address} created!"
|
||||||
|
|
10
sshfs_gui.sh
10
sshfs_gui.sh
|
@ -17,12 +17,15 @@
|
||||||
#
|
#
|
||||||
# Email: tildelinux@tildeverse.org
|
# Email: tildelinux@tildeverse.org
|
||||||
|
|
||||||
|
export SSH_ASKPASS="/usr/lib/ssh/x11-ssh-askpass"
|
||||||
|
|
||||||
setup_script_path="$HOME/.local/bin/setup_gui.sh"
|
setup_script_path="$HOME/.local/bin/setup_gui.sh"
|
||||||
|
|
||||||
eval "$(xdotool getmouselocation --shell)"
|
eval "$(xdotool getmouselocation --shell)"
|
||||||
mouse_x=$X
|
mouse_x=$X
|
||||||
mouse_y=$Y
|
mouse_y=$Y
|
||||||
|
|
||||||
|
mounts_file="$HOME/.ssh/mounts"
|
||||||
ssh_config_file="$HOME/.ssh/config"
|
ssh_config_file="$HOME/.ssh/config"
|
||||||
server_name=$(grep -E "[H,h]ost " "$ssh_config_file" \
|
server_name=$(grep -E "[H,h]ost " "$ssh_config_file" \
|
||||||
| cut -f 2 -d ' ' \
|
| cut -f 2 -d ' ' \
|
||||||
|
@ -152,24 +155,25 @@ configure_mount() {
|
||||||
test -e "$sshfs_local_path" \
|
test -e "$sshfs_local_path" \
|
||||||
|| mkdir -p "$sshfs_local_path"
|
|| mkdir -p "$sshfs_local_path"
|
||||||
|
|
||||||
if ! ssh "$server_name" "test -d \${sshfs_remote_path}"
|
if ! setsid -w ssh "$server_name" "test -d \${sshfs_remote_path}"
|
||||||
then
|
then
|
||||||
if dec_box "Directory $sshfs_remote_path does not exist on remote host, create?"
|
if dec_box "Directory $sshfs_remote_path does not exist on remote host, create?"
|
||||||
then
|
then
|
||||||
if ! error_msg=$(ssh "$server_name" "mkdir \${sshfs_remote_path}" 2>&1)
|
if ! error_msg=$(setsid -w ssh "$server_name" "mkdir \${sshfs_remote_path}" 2>&1)
|
||||||
then
|
then
|
||||||
error_box "Failed to create remote directory. ${error_msg}"
|
error_box "Failed to create remote directory. ${error_msg}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if error_msg=$(sshfs \
|
if error_msg=$(setsid -w sshfs \
|
||||||
"${server_name}:${sshfs_remote_path}" \
|
"${server_name}:${sshfs_remote_path}" \
|
||||||
"$sshfs_local_path" \
|
"$sshfs_local_path" \
|
||||||
-oauto_cache,reconnect,Compression=no 2>&1)
|
-oauto_cache,reconnect,Compression=no 2>&1)
|
||||||
then
|
then
|
||||||
kill $info_pid
|
kill $info_pid
|
||||||
succ_box "Successfuly linked ${sshfs_local_path} to ${sshfs_remote_path} on ${server_name}"
|
succ_box "Successfuly linked ${sshfs_local_path} to ${sshfs_remote_path} on ${server_name}"
|
||||||
|
printf "SSHFS Mount %s (%s)\\n" "${sshfs_local_path}" "${server_name}" >> "$mounts_file"
|
||||||
else
|
else
|
||||||
kill $info_pid
|
kill $info_pid
|
||||||
error_box "Failed to link ${sshfs_local_path} to ${sshfs_remote_path} on ${server_name}\\n${error_msg}"
|
error_box "Failed to link ${sshfs_local_path} to ${sshfs_remote_path} on ${server_name}\\n${error_msg}"
|
||||||
|
|
Loading…
Reference in New Issue