File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 85
85
apt-get install -y --no-install-recommends $need_packages
86
86
fi
87
87
88
- clone=/mnt/clone
89
- clone_src=/mnt/clone-src
90
- clone_log=/var/log/$PGM .log
88
+ export clone=/mnt/clone
89
+ export clone_src=/mnt/clone-src
90
+ export clone_log=/var/log/$PGM .log
91
91
92
92
HOSTNAME=` hostname`
93
93
Original file line number Diff line number Diff line change 4
4
# eg: sudo rpi-clone-setup bozo
5
5
#
6
6
# This script is automatically run by rpi-clone (when it is given -s options)
7
- # to setup an alternate hostname. A cloned file system mounted on /mnt/clone
8
- # is expected unless testing with the -t option.
7
+ # to setup an alternate hostname. It expects $clone to be set in the
8
+ # environment containing the path to a mounted cloned file system unless
9
+ # testing with the -t option.
9
10
#
10
11
# Or, this script can be run by hand at the end of a clone when rpi-clone
11
- # pauses with the cloned file systems still mounted on /mnt/clone.
12
+ # pauses with the cloned file systems still mounted (make sure to set
13
+ # the $clone env variable properly, then).
12
14
#
13
15
# Or, run this script by hand with -t to process files in test directories
14
16
# under /tmp/clone-test. Run -t and look at the files to see if the files
27
29
28
30
file_list=" etc/hostname etc/hosts"
29
31
30
- clone=/mnt/clone
32
+ # $ clone is set by caller
31
33
clone_test=/tmp/clone-test
32
34
33
35
PGM=` basename $0 `
81
83
82
84
echo -e " \t$newhost \t- target hostname"
83
85
84
- if (( ! testing)) && [ ! -d /mnt/ clone/etc ]
86
+ if (( ! testing)) && [ -z " $ clone" ]
85
87
then
86
- echo " A destination clone file system is not mounted on /mnt/clone"
88
+ echo " No clone mountpoint was passed in the \$ clone variable"
89
+ echo " Aborting!"
90
+ exit 0
91
+ fi
92
+ if (( ! testing)) && [ ! -d " $clone /etc" ]
93
+ then
94
+ echo " A destination clone file system is not mounted on $clone "
87
95
echo " Aborting!"
88
96
exit 0
89
97
fi
You can’t perform that action at this time.
0 commit comments