-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path1-createsrc
68 lines (59 loc) · 2.07 KB
/
1-createsrc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
#Get the vanilla firmware and break it out
. ./0-vars
#Possible passwords
#1NIf_2yUOlRDpYZUVNqboRpMBoZwT4PzoUvOPUp6l
#aAhvlM1Yp7_2VSm6BhgkmTOrCN1JyE0C5Q6cB3oBB
#YvSInIQopeipx66t_DCdfEvfP47qeVPhNhAuSYmA4
#IeY8omJwGlGkIbJm2FH_MV4fLsXE8ieu0gNYwE6Ty
OLDSRC=./old-src
echo $0 running...
echo " Making sure that files that are not synced with GitHub are present"
if [ ! -f $FIRMWAREZIP ]; then
echo " -- Getting Linkstation firmware"
cd $FIRMWARES
sh scripts/get-firmware
cd $FIRMWARESBACKOUT
if [ ! -f $FIRMWAREZIP ]; then
echo "***"
echo "*** I don't have the links to Linkstation firmware $VERSIONDOT. Please download it manually and put it into $FIRMWARES before you continue. ***"
echo "***"
echo "Sleeping 10 seconds so you can cancel the script."
sleep 10
exit 1
fi
fi
if [ ! -f $FIRMWARES/$PLEXBIN ]; then
echo " -- Getting Plex Media Server package"
if [ "x$PLEXBIN" == "xPlexMediaServer-0.9.11.7.803-87d0708-arm.spk" ]; then
wget https://downloads.plex.tv/plex-media-server/0.9.11.7.803-87d0708/PlexMediaServer-0.9.11.7.803-87d0708-arm.spk -O $FIRMWARES/PlexMediaServer-0.9.11.7.803-87d0708-arm.spk
else
echo "***"
echo "*** I don't have the links to $PLEXBIN. Please download it manually and put it into $FIRMWARES before you continue. ***"
echo "***"
echo "Sleeping 10 seconds so you can cancel the script."
sleep 10
exit 1
fi
fi
if [ "x`whoami`" != "xroot" ]; then
echo "You need to be root to properly unzip the firmware. (Special files need special privileges.)"
exit
fi
[ -d $FIRMWARESHELL ] && rm -rf $FIRMWARESHELL
echo " Unzipping $FIRMWAREZIP"
if [ $LINKSTATION -eq 1 ]; then
unzip -q -o $FIRMWAREZIP -d $RESOURCES
else
mkdir $FIRMWARESHELL
unzip -q -o $FIRMWAREZIP -d $FIRMWARESHELL
fi
echo " Unzipping hddrootfs.img"
unzip -q -o -d $RESOURCES -P "`cat $RESOURCES/password$VERSION`" $HDDROOTFSPATH/hddrootfs.img
rm $HDDROOTFSPATH/hddrootfs.img
rm -rf $OLDSRC
test -d $SRC && mv $SRC $OLDSRC
mkdir $SRC
echo " Untarring hddrootfs.buffalo.updated"
tar -xzf $RESOURCES/hddrootfs.buffalo.updated -C $SRC
rm $RESOURCES/hddrootfs.buffalo.updated