Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 1 | #!bin/sh |
| 2 | |
| 3 | reset |
| 4 | |
| 5 | echo "Exiting petitboot. Type 'exit' to return." |
| 6 | echo "You may run 'pb-sos' to gather diagnostic data" |
| 7 | |
| 8 | if [[ "$(id -u)" != "0" ]]; then |
| 9 | echo "" | sudo -S /bin/true 2&>1 >> /dev/null |
| 10 | if [[ $? = 0 ]]; then |
Samuel Mendoza-Jonas | b99c501 | 2019-02-21 10:29:12 +1100 | [diff] [blame] | 11 | echo "No password set, running as root. You may set a password in the System Configuration screen." |
Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 12 | sudo -i |
Samuel Mendoza-Jonas | 27f8555 | 2019-02-18 10:40:29 +1100 | [diff] [blame] | 13 | sudo -K |
Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 14 | exit |
| 15 | fi |
Samuel Mendoza-Jonas | 27f8555 | 2019-02-18 10:40:29 +1100 | [diff] [blame] | 16 | export PS1='$ ' |
| 17 | else |
| 18 | export PS1='# ' |
Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 19 | fi |