-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtinycore-scripts-download
More file actions
54 lines (48 loc) · 1.57 KB
/
tinycore-scripts-download
File metadata and controls
54 lines (48 loc) · 1.57 KB
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
50
51
52
53
54
###############################################################################
#
# This script download all other scripts so it should be used as second step,
# after using 'tinycore-install'. Then you should be good to easily tune
# the server.
#
# It can also be used to update the scripts to the latest version.
#
# Download and run this script:
#
# mkdir /opt/tinycore-scripts <- place to store files
# cd /opt/tinycore-scripts
# tce-load -w -i openssl.tcz <- enable ssl (for https)
# wget git.io/tinycore-scripts-download <- download this script
# sh tinycore-scripts-download <- run
#
# What tinycore-scripts-download does:
# - Download all other scripts to the working directory
#
# Credits:
# By paulo.amaral(a)gmail(dot)com - https://github.com/paulera
#
###############################################################################
#!/bin/sh
BASE_URL=https://raw.githubusercontent.com/paulera/setup-tinycore-scripts/master
USER=paulera
REPO=setup-tinycore-scripts
TIMESTAMP=`date +%s`
TMP=tmp_download_$TIMESTAMP
echo
echo "This script does NOT download tinycore-install."
echo
if [ ! -z $(command -v tce-load) ]; then
tce-load -w -i openssl.tcz;
fi
mkdir $TMP
cd $TMP
for i in `wget -qO- https://api.github.com/repos/$USER/$REPO/contents/ | cat | \
grep \"download_url\" | \
grep -i -v "/readme.md\"" | \
grep -i -v "/tinycore-install\"", | \
sed 's/[ ]\+"download_url": "\(.*\)"[,]*/\1/g' \
`; do
echo "Downloading $i ..."
wget --no-cache -q $i
done
cd ..
cp $TMP/* . && rm -r $TMP