Skip to content

Instantly share code, notes, and snippets.

@asdfugil
Last active April 6, 2021 01:48
Show Gist options
  • Save asdfugil/61238df5cdd4f1b68b7cf8a76412b42d to your computer and use it in GitHub Desktop.
Save asdfugil/61238df5cdd4f1b68b7cf8a76412b42d to your computer and use it in GitHub Desktop.
Ubuntu-like motd for Procursus

Ubuntu-like motd for Procursus

Ubuntu-like motd for jailbroken iOS users using the Procursus bootstrap. Supports bash and zsh.

Installation

  1. Install dependencies: sudo apt install coreutils grep nodejs darwintools
  2. Copy the text of greeting.sh
  3. Create a file at /etc/profile.d/greeting.sh and paste the contents.
  4. Test it. Try opening NewTerm.
run_on_login() {
PROCURSUS_VERSION=$(node -e "process.stdout.write(require('fs').readFileSync('/etc/apt/sources.list.d/procursus.sources','utf8').split('\n').find(x => x.startsWith('Suites:')).split('/')[1].slice(0,-2))")
echo "Welcome to Procursus "$PROCURSUS_VERSION" ($(sw_vers -productName) $(sw_vers -productVersion)/$(uname -srp))"
cat << EOF
* Development: https://github.com/ProcursusTeam/Procursus
* Support: https://diatr.us/discord
* Issue tracker: https://github.com/ProcursusTeam/Procursus/issues
Procursus comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
EOF
echo $(($(apt list --upgradable 2> /dev/null | wc -l) - 1))" package(s) can be updated."
echo $(apt list --upgradable 2>/dev/null | grep "\-security" | wc -l) "updates are security updates." # always 0 lol
last
}
# zsh
if [[ -o login ]];then
run_on_login
fi
# bash
shopt -q login_shell 2> /dev/null && run_on_login
# idk about ash, fish and dash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment