Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toggle_oem_run_once () {
- # Task to run the OEM post configuaration on first login.
- # the OEM post configuration may allow for interaction if desired and would
- # best run on several distributions and in a full graphic environment.
- #
- # Globals:
- # Arguments: [script path] [optional:path to .desktop launcher]
- # Outputs:
- # Returns:
- # Usage:
- #
- # setup_oem_run_once /path/to/script.sh
- # End of documentation
- _FILE=${2:-"/etc/xdg/autostart/oem-run.desktop"}
- # If the launcher exists, delete it, else create it.
- if [[ -e ${_FILE} ]] ; then
- if [[ -w "${_FILE}" ]]
- then
- write_information "Removing execution on login of (${_FILE})"
- rm ${_FILE}
- else
- write_warning "Write permission is NOT granted on ${_FILE}"
- write_status "Requesting elevated privileges..."
- sudo rm ${_FILE}
- fi
- else
- cat > ${_FILE} <<-CREATE_START_LINK
- # This will automatically start the RuntTime Data OEM config options on
- # the first login. Once run this launcher will be moved to the /opt/rtd folder
- # so that subsequent logins will not be plagued by the OEM setup.
- #
- [Desktop Entry]
- Type=Application
- Exec=sudo -E $1
- Terminal=true
- Hidden=false
- X-GNOME-Autostart-enabled=true
- Name=${_BACK_TITLE} OEM Run
- Comment=OEM
- CREATE_START_LINK
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement