Update upscripts.sh
This commit is contained in:
35
upscripts.sh
35
upscripts.sh
@@ -3,7 +3,7 @@
|
||||
|
||||
action="$1"
|
||||
useAutoremove=1
|
||||
FOLDER='/opt/LinUPx'
|
||||
FOLDER='/opt/ubuntu-upscripts'
|
||||
|
||||
Color_Off='\033[0m'
|
||||
Blue='\033[0;34m'
|
||||
@@ -29,6 +29,9 @@ else
|
||||
ATYPE="unknown"
|
||||
fi
|
||||
|
||||
$APTFUNC remove -y newrelic-sysmond
|
||||
rm -f /etc/apt/sources.list.d/newrelic.list
|
||||
|
||||
UPDATE1() {
|
||||
if type yum &>/dev/null; then
|
||||
$APTFUNC -y update
|
||||
@@ -70,6 +73,19 @@ DISTUPGRADE() {
|
||||
if [ ${action-x} ]; then exit 0; fi
|
||||
read -n 1 -s -p "Press any key to continue"
|
||||
}
|
||||
PIPUPGRADE() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
sudo pip install --upgrade pip
|
||||
sudo pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
|
||||
else
|
||||
pip install --upgrade pip
|
||||
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
|
||||
fi
|
||||
echo ""
|
||||
echo -e "${Green}Python-Pip Upgrades has completed${Color_Off}"
|
||||
if [ ${action-x} ]; then exit 0; fi
|
||||
read -n 1 -s -p "Press any key to continue"
|
||||
}
|
||||
AUTOREMOVE() {
|
||||
if [ "$useAutoremove" -ne 0 ]; then
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
@@ -170,6 +186,8 @@ SCRIPT_MENU() {
|
||||
echo "-------------------------------------------------------------"
|
||||
echo " $(hostname --long)"
|
||||
echo "-------------------------------------------------------------"
|
||||
lsb_release -a
|
||||
echo "-------------------------------------------------------------"
|
||||
echo ""
|
||||
echo " [1] Check for Updates/Upgrades"
|
||||
echo " [2] Run Updates"
|
||||
@@ -179,8 +197,9 @@ SCRIPT_MENU() {
|
||||
echo ""
|
||||
echo " [4] Check for Upgrades with obsoletes enabled"
|
||||
echo " [5] Run Dist-Upgrade"
|
||||
echo " [6] Run Python-Pip Upgrades"
|
||||
echo ""
|
||||
echo " [6] Enable/Disable Automatic Security Updates"
|
||||
echo " [0] Enable/Disable Automatic Security Updates"
|
||||
echo ""
|
||||
echo " [R] Reboot System"
|
||||
echo " [S] Shutdown System"
|
||||
@@ -201,7 +220,9 @@ SCRIPT_MENU() {
|
||||
SCRIPT_MENU;;
|
||||
5) DISTUPGRADE
|
||||
SCRIPT_MENU;;
|
||||
6) ENDISASU
|
||||
6) PIPUPGRADE
|
||||
SCRIPT_MENU;;
|
||||
0) ENDISASU
|
||||
SCRIPT_MENU;;
|
||||
[Rr]) GO_REBOOT
|
||||
SCRIPT_MENU;;
|
||||
@@ -236,8 +257,8 @@ if [ ${action-x} ]; then
|
||||
exit 1;;
|
||||
esac
|
||||
else
|
||||
if [ -e /opt/LinUPx/upscripts-install.sh ]; then
|
||||
rm -f /opt/LinUPx/upscripts-install.sh
|
||||
if [ -e /opt/ubuntu-upscripts/upscripts-install.sh ]; then
|
||||
rm -f /opt/ubuntu-upscripts/upscripts-install.sh
|
||||
fi
|
||||
if [ -e ~/runup.sh ]; then
|
||||
rm -f ~/runup.sh
|
||||
@@ -252,7 +273,7 @@ else
|
||||
fi
|
||||
|
||||
# ruTARGET=$"`file ~/runup.sh | awk '{print $5}'`"
|
||||
# if [ $ruTARGET == "/opt/LinUPx/upscripts.sh" ] || [ $ruTARGET == "\`/opt/LinUPx/upscripts.sh'" ]; then
|
||||
# if [ $ruTARGET == "/opt/ubuntu-upscripts/upscripts.sh" ] || [ $ruTARGET == "\`/opt/ubuntu-upscripts/upscripts.sh'" ]; then
|
||||
# rm ~/runup.sh
|
||||
# ln -s $FOLDER/run.sh ~/runup.sh
|
||||
# echo "Recreated runup.sh link to point to the new loader script..."
|
||||
@@ -262,4 +283,4 @@ else
|
||||
SCRIPT_MENU
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
Reference in New Issue
Block a user