1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #!/bin/sh
-
- PATH=/sbin:/usr/sbin:/bin:/usr/bin
- NAME="lxqt-cheatcodes"
-
- if [ -r /etc/default/distro ]; then
- . /etc/default/distro
- fi
-
- . /lib/lsb/init-functions
-
- . /lib/init/fll
-
- ###
- # read in variables from /etc/default/fll-locales
- ###
- if [ -r /etc/default/fll-locales ]; then
- . /etc/default/fll-locales
- fi
-
- FLL_LIVE_USER_HOME=$(getent passwd ${FLL_LIVE_USER} | cut -d \: -f 6)
-
-
- timedatectl set-timezone $(timedatectl | awk '/Local/{printf $6}')
-
- ###
- # cheatcode handling
- ###
- for param in $(cat /proc/cmdline); do
- case "${param}" in
- flldebug=*)
- if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
- fll_redirect
- fi
- ;;
- nointro)
- NOINTRO="nointro"
- ;;
- esac
- done
-
- no_intro() {
- if [ -z "${NOINTRO}" ] ; then
- [ ! -f ${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop ] && sudo -u ${FLL_LIVE_USER} ln -sf "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop" \
- "${FLL_LIVE_USER_HOME}/.config/autostart/"
- elif [ -e "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop" ]; then
- # toram + persistency
- rm -f "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop"
- fi
- }
-
- do_start() {
- if [ -f ${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop ]; then
- no_intro
- fi
- }
-
- case "${1}" in
- start)
- log_daemon_msg "${NAME}"
- do_start
- log_end_msg "${?}"
- ;;
- stop)
- ;;
- restart|force-reload)
- echo "Error: argument '${1}' not supported" >&2
- exit 3
- ;;
- *)
- echo "Usage: ${NAME} {start|stop}" >&2
- exit 3
- ;;
- esac
|