Commit f0eeafca authored by Marco Marinello's avatar Marco Marinello

Update scripts to use debhelper

Signed-off-by: Marco Marinello's avatarMarco Marinello <mmarinello@sezf.it>
parent ca7fa2ad
......@@ -2,8 +2,12 @@
CLONEZILLA_HOME=$(getent passwd clonezilla|cut -d : -f 6)
#
# First of all, place the SSH configuration for clonezilla and root@proxy
#
mkdir -p ${CLONEZILLA_HOME}/.ssh
rm -rf ${CLONEZILLA_HOME}/.ssh/*
#rm -rf ${CLONEZILLA_HOME}/.ssh/*
cp /usr/share/fuss-fucc/clonezilla_live.pub ${CLONEZILLA_HOME}/.ssh/authorized_keys
ssh-keyscan -H proxy > ${CLONEZILLA_HOME}/.ssh/known_hosts 2>/dev/null
......@@ -23,6 +27,31 @@ fi
chown -R clonezilla. ${CLONEZILLA_HOME}/.ssh
chmod 400 ${CLONEZILLA_HOME}/.ssh/id_rsa*
chown -R clonezilla. ${CLONEZILLA_HOME}/clientScripts
chmod -R 770 ${CLONEZILLA_HOME}/clientScripts
chown clonezilla. ${CLONEZILLA_HOME}/computerList.txt
#
# Then get the SFTP directoty and copy the files
#
#DEBHELPER#
# Source debconf
. /usr/share/debconf/confmodule
# Get the directory
db_get fuss-fucc/sftp_directory
SFTPDIR="$RET"
# Fix the directory in pxelinux
sed -i "s+/srv/clonezilla+$SFTPDIR+g" /srv/tftp/pxelinux.cfg/default
# Copy required files
mkdir -p $SFTPDIR
cp -R /usr/share/fuss-fucc/clonezilla/clientScripts ${SFTPDIR}
test -e ${SFTPDIR}/computerList.txt || cp /usr/share/fuss-fucc/clonezilla/computerList.txt ${SFTPDIR}
chown -R clonezilla. ${SFTPDIR}/clientScripts
chmod -R 770 ${SFTPDIR}/clientScripts
chown clonezilla. ${SFTPDIR}/computerList.txt
#!/bin/bash
#DEBHELPER#
rm -rf /srv/tftp/pxelinux.cfg/default /srv/tftp/clonezilla
#!/bin/bash
# Source debconf
. /usr/share/debconf/confmodule
#DEBHELPER#
# Get the directory
db_get fuss-fucc/sftp_directory
SFTPDIR="$RET"
# Remove installed files
rm -rf ${SFTPDIR}/clientScripts
# Do not delete computerList.txt as far as it may still be useful
# Prune the debconf database
db_purge
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment