#!/bin/sh # # Petitboot utility script for running a petitboot UI program # on a console tty. # # Copyright © 2017 Raptor Engineering, LLC # Released under the terms of the GNU GPL v2 for f in /etc/environment /etc/locale do if [ -e "$f" ] then export $(cat "$f") fi done case "$(tty)" in /dev/tty[0-9]*) export TERM=linux ;; esac if [ -z "$PATH" ] then PATH=/usr/bin:/usr/sbin:/bin:/sbin fi PATH=/var/lib/pb-plugins/bin:$PATH export PATH echo 0 > /proc/sys/kernel/printk clear if [ -e /etc/pb-lockdown ]; then echo "Failed to launch petitboot, rebooting!" echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger else echo "Failed to launch petitboot, dropping to a shell" exec sh fi