Altiris Deployment Scripts for HP thin clients

From Wiki

Jump to:navigation, search

HP t5125

The t5125 uses a HP customised Linux distro. The scripts below can be found at [1].

Capturing Settings

<bash>

  1. !/bin/sh
  2. only edit the following varilbles

FILENAME=hires_HPLinuxTCSettings DESTINATION=//myServer/eXpress USERNAME=myDomain/administrator PASSWORD=myPassword

  1. do not edit below

PATH=/tmp/HPCS:$PATH chmod 777 /tmp/HPCS/snapshot chmod 777 /tmp/HPCS/tar chmod 777 /tmp/HPCS/smbput.sh

  1. if you would like to use a custom snapshot file
  2. download it to /tmp/HPCS/snapshot.conf.base

if test -e "/tmp/HPCS/snapshot.conf.base"; then

 cp /tmp/HPCS/snapshot.conf.base /etc/snapshot.conf.base

fi

  1. use the base file to accomidate the dynamic detection
  2. of some user settings (ie: connections assigned to users)

if test -e "/etc/snapshot.conf.base"; then

 cp /etc/snapshot.conf.base /etc/snapshot.conf

else

 cp /etc/snapshot.conf /etc/snapshot.conf.base

fi


  1. adding user connection settings

echo "[ userconnections ]" >> /etc/snapshot.conf find / -name hpconman.inf >> /etc/snapshot.conf

echo "[ usersettings ]" >> /etc/snapshot.conf find / -name Autostart >> /etc/snapshot.conf find / -name .ICAClient >> /etc/snapshot.conf find / -name .xautolock >> /etc/snapshot.conf find / -name .xfce4 >> /etc/snapshot.conf

echo "[ menus ]" >> /etc/snapshot.conf find / -name menu.xml.* >> /etc/snapshot.conf

echo "[ keythemerc ]" >> /etc/snapshot.conf find / -name keythemerc >> /etc/snapshot.conf

  1. collect and tar the files, then compress the package

snapshot /tmp/HPCS/$FILENAME.tar -s -v gzip /tmp/HPCS/$FILENAME.tar


  1. upload to server

/tmp/HPCS/smbput.sh -f /tmp/HPCS/$FILENAME.tar.gz -d $DESTINATION -u $USERNAME -p $PASSWORD rm /tmp/HPCS/$FILENAME.tar.gz </bash>

This script produces a file like that found at [2].

Deploying Settings

<bash>

  1. !/bin/sh
  2. check the following varibles
  3. to only restore files defined for GROUP in /etc/snapshot.conf
  4. use GROUP_TO_RESTORE
  5. if deploy all settings or vnc set RESET_VNC=TRUE otherwise set to FALSE
  6. if deploy all settings or vnc set RESET_SHELL=TRUE otherwise set to FALSE

FILENAME=t5125_HPLinuxTCSettings GROUP_TO_RESTORE= RESET_VNC=FALSE RESET_SHELL=FALSE

  1. do not edit below

PATH=/tmp/HPCS:$PATH chmod 777 /tmp/HPCS/snapshot chmod 777 /tmp/HPCS/tar


if [ x"TRUE" = x"$RESET_VNC" ]; then

 rm -fr /etc/.vnc

fi


if [ x"TRUE" = x"$RESET_SHELL" ]; then

 rm -fr /etc/.hpconman/shell

fi


gunzip /tmp/HPCS/$FILENAME.tar.gz tar -xPf /tmp/HPCS/$FILENAME.tar /etc/snapshot.conf if [ x"" = x"$GROUP_TO_RESTORE" ]; then

 snapshot /tmp/HPCS/$FILENAME.tar -r 

else

 snapshot /tmp/HPCS/$FILENAME.tar -r $GROUP_TO_RESTORE

fi

rm /tmp/HPCS/$FILENAME.tar </bash>

HP t5725

The t5725 is a Debian Linux-based terminal.

The scripts below, were adapted from those supplied by HP - available from [3].

Capturing Settings

Simply configure the terminal as you wish and then run the following script from the Deployment Console.

<bash>

  1. !/bin/sh
  2. only edit the following variables

FILENAME=t5725_HPLinuxTCSettings DESTINATION=//myServer/eXpress USERNAME=myDomain/administrator PASSWORD=myPassword

  1. do not edit below

PATH=/tmp/HPCS:/mnt/opt/altiris/deployment/adlagent/bin:$PATH chmod 777 /tmp/HPCS/snapshot chmod 777 /tmp/HPCS/tar chmod 777 /tmp/HPCS/smbput.sh

  1. if you would like to use a custom snapshot file
  2. download it to /tmp/HPCS/snapshot.conf.base

if test -e "/tmp/HPCS/snapshot.conf.base"; then

 cp /tmp/HPCS/snapshot.conf.base /etc/snapshot.conf.base

fi

  1. use the base file to accomidate the dynamic detection
  2. of some user settings (ie: connections assigned to users)

if test -e "/etc/snapshot.conf.base"; then

 cp /etc/snapshot.conf.base /etc/snapshot.conf

else

 cp /etc/snapshot.conf /etc/snapshot.conf.base

fi


  1. adding user connection settings

echo "[ userconnections ]" >> /etc/snapshot.conf find / -name hpconman.inf >> /etc/snapshot.conf echo "[ usersettings ]" >> /etc/snapshot.conf find / -name Autostart >> /etc/snapshot.conf find / -name autologin >> /etc/snapshot.conf find / -name .ICAClient >> /etc/snapshot.conf find / -name .xautolock >> /etc/snapshot.conf find / -name .xfce4 >> /etc/snapshot.conf find / -name .icewm >> /etc/snapshot.conf find / -name .xsession >> /etc/snapshot.conf echo "[ menus ]" >> /etc/snapshot.conf find / -name menu.xml.* >> /etc/snapshot.conf echo "[ keythemerc ]" >> /etc/snapshot.conf find / -name keythemerc >> /etc/snapshot.conf

  1. collect and tar the files, then compress the package

snapshot /tmp/HPCS/$FILENAME.tar -s -v gzip /tmp/HPCS/$FILENAME.tar

  1. collect extra bits

tar -czf /tmp/HPCS/extras.tar.gz /usr/bin/autologin /etc

  1. upload to server

/tmp/HPCS/smbput.sh -f /tmp/HPCS/$FILENAME.tar.gz -d $DESTINATION -u $USERNAME -p $PASSWORD /tmp/HPCS/smbput.sh -f /tmp/HPCS/extras.tar.gz -d $DESTINATION -u $USERNAME -p $PASSWORD

        1. rm /tmp/HPCS/$FILENAME.tar.gz

</bash>

This script will create a file named t5725_HPLinuxTCSettings.tar.gz on your server. This file contains all the relevant settings needed for deployment. An example file can be found at [4].

Deploying Settings

Use the following script to deploy the settings stored in the file created above:

<bash>

  1. !/bin/sh
  2. check the following varibles
  3. to only restore files defined for GROUP in /etc/snapshot.conf
  4. use GROUP_TO_RESTORE
  5. if deploy all settings or vnc set RESET_VNC=TRUE otherwise set to FALSE
  6. if deploy all settings or vnc set RESET_SHELL=TRUE otherwise set to FALSE

FILENAME=t5725_HPLinuxTCSettings GROUP_TO_RESTORE= RESET_VNC=FALSE RESET_SHELL=FALSE

  1. do not edit below

PATH=/tmp/HPCS:/mnt/opt/altiris/deployment/adlagent/bin:$PATH chmod 777 /tmp/HPCS/snapshot chmod 777 /tmp/HPCS/tar


if [ x"TRUE" = x"$RESET_VNC" ]; then

 rm -fr /etc/.vnc

fi

if [ x"TRUE" = x"$RESET_SHELL" ]; then

 rm -fr /etc/.hpconman/shell

fi


gunzip /tmp/HPCS/$FILENAME.tar.gz tar -xPf /tmp/HPCS/$FILENAME.tar /etc/snapshot.conf

if [ x"" = x"$GROUP_TO_RESTORE" ]; then

 snapshot /tmp/HPCS/$FILENAME.tar -r 

else

 snapshot /tmp/HPCS/$FILENAME.tar -r $GROUP_TO_RESTORE

fi


cd / tar xzvf /tmp/HPCS/extras.tar.gz

  1. rm /tmp/HPCS/$FILENAME.tar

</bash>

You can now simply use Altiris Deployment Console to rename the clients.