forked from docker-library/php
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-php-source
More file actions
Latest commit
executable file
·34 lines (29 loc) · 587 Bytes
/
Copy pathdocker-php-source
File metadata and controls
executable file
·34 lines (29 loc) · 587 Bytes
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
#!/bin/sh
set -e
dir=/usr/src/php
usage() {
echo"usage: $0 COMMAND"
echo
echo"Manage php source tarball lifecycle."
echo
echo"Commands:"
echo" extract extract php source tarball into directory $dir if not already done."
echo" delete delete extracted php source located into $dir if not already done."
echo
}
case"$1"in
extract)
mkdir -p "$dir"
if [ !-f"$dir/.docker-extracted" ];then
tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1
touch "$dir/.docker-extracted"
fi
;;
delete)
rm -rf "$dir"
;;
*)
usage
exit 1
;;
esac