diff options
author | ramon <ramongomez@us.es> | 2017-06-23 08:51:30 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2017-06-23 08:51:30 +0000 |
commit | 4be0673ea85bd7547abfebad8788f784cc050667 (patch) | |
tree | b4c0b380009b5656a760e41f8098352e5a828176 /server/bin/oglivecli | |
parent | 57396c13d760a668978893a9a1e70e891d7021c1 (diff) |
#768: {{{oglivecli install}}} solo instala pero no lo marca por defecto.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5374 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'server/bin/oglivecli')
-rwxr-xr-x | server/bin/oglivecli | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/server/bin/oglivecli b/server/bin/oglivecli index 3261e13d..3feb5901 100755 --- a/server/bin/oglivecli +++ b/server/bin/oglivecli @@ -44,8 +44,7 @@ EOT INDEX=$n jq ".oglive |= (. + [$DATA])" $INFOFILE | sponge $INFOFILE fi - # Update dafault index. - jq ".default=$INDEX" $INFOFILE | sponge $INFOFILE + # Show JSON entry. jq ".oglive[$INDEX]" $INFOFILE else # Create new JSON file. @@ -304,16 +303,19 @@ function install() { # Make ogLive backup. rm -fr ${OGLIVEDIR}.old mv -fv $OGLIVEDIR ${OGLIVEDIR}.old 2>/dev/null - # Mount ogLive ISO image, update its files, unmount it and set as default. + # Mount ogLive ISO image, update its files and unmount it. TMPDIR=/tmp/${OGLIVEFILE%.iso} mkdir -p $OGLIVEDIR $TMPDIR trap "umount $TMPDIR; rm -fr $TMPDIR" 1 2 3 6 9 15 mount -o loop,ro $OGLIVEFILE $TMPDIR cp -va $TMPDIR/ogclient/* $OGLIVEDIR || raiseError access "Cannot copy files to ogLive directory." umount $TMPDIR - rm -f $TFTPDIR/$DEFOGLIVE - ln -vfs $(basename $OGLIVEDIR) $TFTPDIR/$DEFOGLIVE - ln -vfs $DEFOGLIVE $TFTPDIR/$OGCLIENT + # Link to default directory if it's the first ogLive. + if [ ! -f $INFOFILE ]; then + rm -f $TFTPDIR/$DEFOGLIVE $TFTPDIR/$OGCLIENT + ln -vfs $(basename $OGLIVEDIR) $TFTPDIR/$DEFOGLIVE + ln -vfs $DEFOGLIVE $TFTPDIR/$OGCLIENT + fi # Recover or ask for a new Samba access key. if [ -n "$SAMBAPASS" ]; then echo -ne "$SAMBAPASS\n$SAMBAPASS\n" | $OPENGNSYS/bin/setsmbpass |