📄 install.sh
字号:
#!/bin/bash## install.sh - A simple installer for Bloat## (c) 2003-2004 Dave Wickham## Released under the GNU GPL v2 or later.## I would release it BSD or public domain, but I already have the GPL in this# archive.## So :-P.#WHITE="\033[1;39m";RED="\033[1;31m";NORMAL="\033[m";echo "Welcome to the Bloat installer. Please select an option:";if [[ $UID != "0" ]]; then echo -e " ${WHITE}[${RED}1${WHITE}]$NORMAL Install for all users (needs the \"root\" [administrator] password)";else echo -e " ${WHITE}[${RED}1${WHITE}]$NORMAL Install for all users";fiecho -e " ${WHITE}[${RED}2${WHITE}]$NORMAL Install into the current user's Nautilus scripts directory";echo;echo -e " ${WHITE}[${RED}U${WHITE}]$NORMAL Uninstall bloat (from /usr/local/bin)";echo -e " ${WHITE}[${RED}Q${WHITE}]$NORMAL Cancel/Quit";read BLOATINSTOPT;if [[ -e "bloat" ]]; then if [[ $BLOATINSTOPT == "1" ]]; then echo "Installing bloat into /usr/local/bin/bloat..."; if [[ $UID != "0" ]]; then echo "Please enter the root (Administrator) password"; fi if [[ `su -c "cp -f bloat /usr/local/bin/ 2>&1" ` ]]; then echo -e "\033[01;31mERROR:\033[m Unable to install bloat to /usr/local/bin/"; BLOATERROR=`cp -f bloat /usr/local/bin/ 2>&1 | sed s/cp:\ //ig` echo "The exact error given was: $BLOATERROR"; exit 1; else echo "Bloat has been succesfully installed!"; exit 0; fi if [[ ! -e "/etc/bloatrc" ]]; then echo "No existing bloat config found - installing example" if [[ `su -c "cp -f bloatrc.sample /etc/bloatrc 2>&1" ` ]]; then echo -e "\033[01;31mERROR:\033[m Unable to install bloat to /usr/local/bin/"; BLOATERROR=`cp -f bloat /usr/local/bin/ 2>&1 | sed s/cp:\ //ig` echo "The exact error given was: $BLOATERROR"; exit 1; else echo "Bloat has been succesfully installed!"; exit 0; fi fi elif [[ $BLOATINSTOPT == "2" ]]; then if [[ ! -e "$HOME/.bloatrc" ]]; then echo "No existing bloat config file found - installing example" cp bloatrc.sample $HOME/.bloatrc fi if [[ -e "$HOME/.gnome2/nautilus-scripts/" ]]; then echo "Installing bloat into $HOME/.gnome2/nautilus-scripts/"; cp bloat $HOME/.gnome2/nautilus-scripts/ DONESTUFF="yes" fi if [[ -e "$HOME/.gnome/nautilus-scripts/" ]]; then echo "Installing bloat into $HOME/.gnome/nautilus-scripts/"; cp bloat $HOME/.gnome/nautilus-scripts/ DONESTUFF="yes" fi if [[ $DONESTUFF != "yes" ]]; then echo -e "${RED}ERROR:$NORMAL Could not find a Nautilus script directory!"; exit 1; else exit 0; fi elif [[ $BLOATINSTOPT == "U" || $BLOATINSTOPT == "u" ]]; then if [[ $UID != "0" ]]; then echo "Please enter the root (Administrator) password"; fi if [[ `su -c "rm -f /usr/local/bin/bloat 2>&1"` ]]; then echo -e "${RED}ERROR:$NORMAL Unable to uninstall bloat from /usr/local/bin/"; BLOATERROR=`su -c "rm -f /usr/local/bin/bloat 2>&1" | sed s/rm:\ //ig` echo "The exact error given was: $BLOATERROR"; exit 1; else echo "Bloat has been succesfully uninstalled!"; exit 0; fi elif [[ $BLOATINSTOPT == "Q" || $BLOATINSTOPT == "q" ]]; then exit 0; else echo -e "${RED}ERROR:$NORMAL Invalid Option!"; exit 1; fielse echo -e "${RED}ERROR:$NORMAL Could not find the bloat script. Please run \"install\" from the directory you\nextracted bloat to.";fi# Last Updated: 2004-12-17
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -