Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dbbfea7f49
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (32 sloc) 0.992 kb
#!/bin/bash
# Here is a suitable bash_login to drop into /home/ubuntu/.bash_login
# Ensures this is an interactive ssh login, then asks the user if they
# want to enable NX functionality.
flagfile=~/.nx_setup_done
setupscript=setupnx.sh
cont=yes
# Do I go ahead?
[ -e "$flagfile" ] && cont=no
[ -n "$SSH_CONNECTION" ] || cont=no
tty -s || cont=no
if [ "$cont" = yes ] ; then
cat <<BLURB
CloudBioLinux comes with FreeNX server to provide a fast remote
desktop on your cloud server instance. Do you wish to configure this now?
y = Yes
n = No, but ask me again next time.
x = No, and do not ask again.
BLURB
read -n 1 -p $'\n [ ]\b\b' answer
answer=`echo "$answer" | tr 'YNX' 'ynx'`
echo
if [ "$answer" = y ] ; then
#Setupscript needs to be executable already.
sudo "$setupscript" $USER && touch "$flagfile"
elif [ "$answer" = x ] ; then
touch "$flagfile"
echo "To initiate setup manually, type 'sudo $setupscript <username>'."
else
echo "Quitting."
fi
fi
Jump to Line
Something went wrong with that request. Please try again.