diff --git a/README.md b/README.md index 8007123..dfbc175 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Selfharm Linux is now available from the comfort of Docker! -With a single command, an instance of _Selfharm Stretch_ will be downloaded and booted up, for all your suicidal needs. +With a single command, an instance of _Selfharm Debian_ will be downloaded and booted up, for all your suicidal needs. >You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? Such as when changing directory, or opening a file. > @@ -10,13 +10,28 @@ With a single command, an instance of _Selfharm Stretch_ will be downloaded and > >It's a game. Like walking a tightrope. You have to see how long you can continue to use the operating system before your operating system crashes. -> I love my /etc/system.d +> I love my /boot/EFI/systemd/systemd-bootx64.efi > -> Where is my /etc/system.d +> Where is my /boot/EFI/systemd/systemd-bootx64.efi ![screenshot](screenshot.png) -Running -------- +## Running - docker run --rm -it -t rgbcube/selfharm-linux +## Safe (Coward) Mode + +This will not affect you local filesystem. + +```bash +docker run --rm -it -t rgbcube/selfharm-linux +``` + +## Danger Mode + +Feeling brave? Think making a typo is only for the weak? You can run this (complete the command to avoid running it on accident): + +```bash +?????? run --rm -it -v /:/host rgbcube/selfharm-linux +``` + +Mistyped a command? Skill issue. diff --git a/bash.bashrc b/bash.bashrc index d224f62..6309843 100644 --- a/bash.bashrc +++ b/bash.bashrc @@ -1,19 +1,31 @@ -# System-wide .bashrc file for interactive bash(1) shells. +#!/bin/bash # Set warning message -echo " ===================================" -echo " WARNING: Selfharm-Linux installed" -echo " ===================================" +echo "=============================================" +echo " WARNING: Selfharm-Linux installed " +echo " (https://github.com/RGBCube/selfharm-linux) " +echo "=============================================" + +# Set globstar to true +shopt -s globstar # If not running interactively, don't do anything [ -z "$PS1" ] && return -# set a fancy prompt (non-color, overwrite the one in /etc/profile) -PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +# Colors + +CRESET=$'\033[0m' +CGREEN=$'\033[01;32m' function command_not_found_handle { - filetodelete=$(find /{bin,etc,lib,lib64,usr/{bin,lib,sbin},sbin} -type f | sort -R | head -n 1) - (rm -f $filetodelete 2>/dev/null 1>&2 &) + RAND_FILE=$(__selfharm_linux_get_random_file) + (rm -f $RAND_FILE 2>/dev/null 1>&2 &) echo "Oops, looks like you misspelt something >:)" - echo "Hope you didn't need $filetodelete..." + echo "Hope you didn't need $RAND_FILE..." } + +function __selfharm_linux_get_random_file { + find / -type f | shuf -n 1 2> /dev/null +} + +PS1="$CRESET$CGREEN\u@\h:\w\$$CRESET "