summaryrefslogtreecommitdiff
path: root/slackware-bootstrap/slackpkg
blob: 20f32e2b6970e49d5bda02986f0dc8d220c037c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m"
printf "\x1b[16;32mREAD CAREFULLY:\n\x1b[0;0m"
echo "this script will open a text editor to edit the mirror list"
echo "for the package manager."
echo "please uncomment a mirror from a location near you,"
echo "by removing the '#' from the beginning of the line."
printf "\x1b[16;32mONLY CHOOSE ONE MIRROR !\n\x1b[0;0m"
printf "\x1b[16;32mDO NOT CHOOSE A -CURRENT MIRROR NOW !\n\x1b[0;0m"
echo "you can save the file by pressing ctrl+x."

printf "\x1b[1;31m================================================================\n\x1b[0;0m"

read -p "press enter to continue"
nano /etc/slackpkg/mirrors

echo "running slackpkg update ..."
slackpkg update

echo "============== [ system update ] ==============="
echo "simply press OK on the package selection screen"
echo "================================================"

read -p "press enter to continue"
echo "running full system update ..."
slackpkg upgrade-all
cp $basedir/slackpkg-blacklist /etc/slackpkg/blacklist
slackpkg update
slackpkg install-new


echo "================= [ system branch ] ==============="
echo "if you would like, you can now exit the mirrors"
echo "and switch to -current. if not, simply press ctrl+x"
echo "==================================================="

read -p "press enter to continue"
nano /etc/slackpkg/mirrors
slackpkg update

echo "would you like to perform a system update now?"
read -p "enter your choice [y/n]: " choice
if [[ $choice == 'y' ]]; then
  echo "running full system update ..."
  slackpkg upgrade-all
  slackpkg install-new
fi