Debian Codegraph @

macosx/ocsinventory_packages_setup/scripts/preinstall

raw
1 #!/bin/sh
2
3 #Setting path to package resources directory
4 BASERESOURCES=$(dirname "$1")
5 RESOURCES="$BASERESOURCES/../Resources"
6
7
8
9 #Setting temp directory
10 if [ $3 ] #If run from NetInstall
11 then
12 TMP_DIR=$3/tmp/ocs_installer
13 else
14 TMP_DIR=/tmp/ocs_installer
15 fi
16
17 #Files we want to copy
18 AGENT_CFG_PATH="ocsinventory-agent.cfg"
19 MODULES_CFG_PATH="modules.conf"
20 LAUNCHD_CFG_PATH="org.ocsng.agent.plist"
21 SERVERDIR_CFG_PATH="serverdir"
22 NOW_PATH="now"
23 CACERT_PATH="cacert.pem"
24
25
26 #Create temporary dir neeeded by postinstall script
27 mkdir -p $TMP_DIR
28
29 if [ -f "$RESOURCES/$AGENT_CFG_PATH" ]
30 then
31 cp $RESOURCES/$AGENT_CFG_PATH $TMP_DIR
32 fi
33
34 if [ -f "$RESOURCES/$MODULES_CFG_PATH" ]
35 then
36 cp $RESOURCES/$MODULES_CFG_PATH $TMP_DIR
37 fi
38
39 if [ -f "$RESOURCES/$LAUNCHD_CFG_PATH" ]
40 then
41 cp $RESOURCES/$LAUNCHD_CFG_PATH $TMP_DIR
42 fi
43
44 if [ -f "$RESOURCES/$SERVERDIR_CFG_PATH" ]
45 then
46 cp $RESOURCES/$SERVERDIR_CFG_PATH $TMP_DIR
47 fi
48
49 if [ -f "$RESOURCES/$NOW_PATH" ]
50 then
51 cp $RESOURCES/$NOW_PATH $TMP_DIR
52 fi
53
54 if [ -f "$RESOURCES/$CACERT_PATH" ]
55 then
56 cp $RESOURCES/$CACERT_PATH $TMP_DIR
57 fi