Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start_environment() {
- ## Prompt the user asking whether or not a graphical session should be started. If the user inputs either 'y',
- ## 'Y', 'yes', YES, or 'Yes', then run start(1) if it is installed. Otherwise, attempt to run MULTIPLEXOR if it is
- ## installed. If neither of the above is possible, then do nothing.
- start_gui=0
- set -- y Y yes YES Yes
- printf "Start graphical user interface? (y/n/N): "
- read -r user_answer
- for answer in "${@}"
- do
- if [ "${user_answer}" = "${answer}" ]; then
- start_gui=1
- fi
- done
- if [ "${start_gui}" -eq 1 ]; then
- if command -v startx > /dev/null 2>&1; then
- startx
- fi
- else
- if command -v "${MULTIPLEXOR}" > /dev/null 2>&1; then
- "${MULTIPLEXOR}"
- fi
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment