mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 12:36:38 +08:00
aed77a8fb2
The latter is more portable, while the former only works on systems where /bin/bash exists (or is symlinked appropriately).
39 lines
804 B
Bash
Executable File
39 lines
804 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
NAME=rclone-hdfs
|
|
KERBEROS=${KERBEROS-"false"}
|
|
|
|
. $(dirname "$0")/docker.bash
|
|
|
|
start() {
|
|
docker run --rm -d --name "rclone-hdfs" \
|
|
--hostname "rclone-hdfs" \
|
|
-e "KERBEROS=$KERBEROS" \
|
|
-p 127.0.0.1:9866:9866 \
|
|
-p 127.0.0.1:8020:8020 \
|
|
-p 127.0.0.1:750:750 \
|
|
-p 127.0.0.1:88:88 \
|
|
rclone/test-hdfs
|
|
sleep 30
|
|
|
|
if [ $KERBEROS = "true" ]; then
|
|
docker cp rclone-hdfs:/tmp/krb5cc_0 /tmp/krb5cc_`id -u`
|
|
fi
|
|
|
|
echo type=hdfs
|
|
echo namenode=127.0.0.1:8020
|
|
echo username=root
|
|
echo _connect=${namenode}
|
|
}
|
|
stop() {
|
|
if status ; then
|
|
docker logs $NAME > .stdout.log 2> .stderr.log
|
|
docker kill $NAME
|
|
echo "$NAME stopped"
|
|
fi
|
|
}
|
|
|
|
. $(dirname "$0")/run.bash
|