-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.mc.menu
49 lines (47 loc) · 2.2 KB
/
.mc.menu
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
= t d
1 Compress the current directory to be published on yourfritz.de
version=$(cat .version)
rm -r bin/000 2>/dev/null
Files="bin files locale modscripts contrib LICENSE BOOTSELECTION* modfs run_modscripts set_correct_flags.sh"
uid_menu=$(stat -c %%u .mc.menu)
gid_menu=$(stat -c %%g .mc.menu)
sudo chown -R $(stat -c %%U .) .
sudo chgrp -R $(stat -c %%G .) .
chmod o-x modscripts/*
sh bin/scripts/generate_flags_script.sh
busybox tar -c --exclude=".git*" --exclude="contrib/custom" $Files | gzip -c9 > "modfs-$version.tgz"
cp modfs-$version.tgz /autofs/ssh/source/srv/www/vhosts/www.yourfritz.de/
sudo chown wwwrun:www /autofs/ssh/source/srv/www/vhosts/www.yourfritz.de/modfs-$version.tgz
opwd=$(pwd)
cd /autofs/ssh/source/srv/www/vhosts/www.yourfritz.de
rm modfs.tgz
ln -s modfs-$version.tgz modfs.tgz
cd $opwd
sudo chgrp $gid_menu .mc.menu
sudo chown $uid_menu .mc.menu
echo "Created (and linked) modfs version $version on yourfritz.de"
tar -t -v -f modfs-$version.tgz
2 Update modfs version timestamp
version="$(cat .version)"
# calling date here needs to use double percent signs to prevent mc variable evaluation
date="$(date +%%d%%m%%Y%%H%%M)"
sed -e "s|^modfs_version=.*|modfs_version=$version-$date|" -i modfs
sed -e "s|^modfs_version=.*|modfs_version=$version-$date|" -i run_modscripts
echo "Updated version string to $version-$date"
3 Compress the current directory to be published on yourfritz.de, but do not replace symlink
version=$(cat .version)
rm -r bin/000 2>/dev/null
Files="bin files locale modscripts contrib LICENSE BOOTSELECTION* modfs run_modscripts set_correct_flags.sh"
uid_menu=$(stat -c %%u .mc.menu)
gid_menu=$(stat -c %%g .mc.menu)
sudo chown -R $(stat -c %%U .) .
sudo chgrp -R $(stat -c %%G .) .
chmod o-x modscripts/*
sh bin/scripts/generate_flags_script.sh
busybox tar -c --exclude=".git*" --exclude="contrib/custom" $Files | gzip -c9 > "modfs-$version.tgz"
# cp modfs-$version.tgz /autofs/ssh/source/srv/www/vhosts/www.yourfritz.de/
# chown wwwrun:www /autofs/ssh/source/srv/www/vhosts/www.yourfritz.de/modfs-$version.tgz
sudo chgrp $gid_menu .mc.menu
sudo chown $uid_menu .mc.menu
echo "Created modfs version $version on yourfritz.de"
tar -t -v -f modfs-$version.tgz