Skip to content

Instantly share code, notes, and snippets.

@twinkfrag
Created April 10, 2018 08:06
Show Gist options
  • Save twinkfrag/d8c5bde02b15623ec8a709aa0830fcbf to your computer and use it in GitHub Desktop.
Save twinkfrag/d8c5bde02b15623ec8a709aa0830fcbf to your computer and use it in GitHub Desktop.
screenの中でしかapt upgradeできないようにする
# write this in /etc/bash.bashrc to cannot "apt upgrade" not in screen
apt() {
if [[ $@ == "upgrade" ]]; then
if [ -n "$STY" ]; then
command apt "$@"
else
echo 'you should apt upgrade in "screen -R"'
fi
else
command apt "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment