Commit 861188dc authored by Daniel Müller's avatar Daniel Müller
Browse files

Change username handling in hda-util

Instead of "Change username yes / no" the stored username is presented
 and used if nothing else is entered.
The desktop launchers now don't skip the username input completely.
Closes #3
parent e214e31d
......@@ -65,23 +65,19 @@ get_username() {
if [ -f $USERNAME_FILE ]; then
username=$(cat $USERNAME_FILE)
if [ -z "$accept_username" ]; then
read -p "Use username: $username? (y/n) " yesno
[ "$yesno" != "y" ] && unset username
fi
echo "Enter st-account name or leave empty for [$username]: "
else
echo "Enter st-account name: "
fi
if [ -z "$username" ]; then
read -p "Enter st-account name: " username
[ -z "$username" ] && exit_msg 1 "No username given"
echo "$username" > $USERNAME_FILE
if [ -z "$accept_username" -o ! -f $USERNAME_FILE ]; then
read new_username
if [ -n "$new_username" ]; then
username="$new_username"
echo "$username" > $USERNAME_FILE
fi
fi
}
......
[Desktop Entry]
Version=1.0
Type=Application
Exec=bash /home/fs/bin/hda-util.sh -y --vpn
Exec=bash /home/fs/bin/hda-util.sh --vpn
StartupNotify=true
Terminal=true
Name=Connect VPN
[Desktop Entry]
Version=1.0
Type=Application
Exec=bash /home/fs/bin/hda-util.sh -y -m home
Exec=bash /home/fs/bin/hda-util.sh -m home
StartupNotify=true
Terminal=true
Name=Open h-da homedir
[Desktop Entry]
Version=1.0
Type=Application
Exec=bash /home/fs/bin/hda-util.sh -y -m labdisk
Exec=bash /home/fs/bin/hda-util.sh -m labdisk
StartupNotify=true
Terminal=true
Name=Open h-da LabDisk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment