#!/bin/bash #!/usr/bin/env bash netid= loginfo "Enter netid: " read -r netid while [[ $netid =~ ^\s*$ ]]; do logwarn "Your netid cannot be blank." loginfo "Enter netid: " done ret_value=$(kinit "$1" &> /dev/null; echo $?) while [[ ! ${kinit "$1" &> /dev/null; echo $?} = "0" ]] do logwarn "Error when authenticating. Please see above issue, and try again." ret_value=$(kinit "$1" &> /dev/null; echo $?) done mkdir /mnt/decs mount -t cifs -o user="$netid",sec=krb5i "//decs/decs/support/dban_logs" /mnt/decs echo "test" > "/mnt/decs/test.txt"