Skip to content

Commit c56de5e

Browse files
committed
debian: Copy Agent configuration from old to new location
We copy some files automatically so the admin doesn't have to worry about the upgrade.
1 parent 4d7dced commit c56de5e

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

debian/cloudstack-agent.postinst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
22+
case "$1" in
23+
configure)
24+
OLDCONFDIR="/etc/cloud/agent"
25+
NEWCONFDIR="/etc/cloudstack/agent"
26+
CONFFILES="agent.properties log4j.xml log4j-cloud.xml"
27+
28+
# Copy old configuration so the admin doesn't have to do that
29+
# Only do so when we are installing for the first time
30+
if [ -z "$2" ]; then
31+
for FILE in $CONFFILES; do
32+
if [ -f "$OLDCONFDIR/${FILE}" ]; then
33+
cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
34+
fi
35+
done
36+
fi
37+
;;
38+
esac
39+
40+
exit 0

0 commit comments

Comments
 (0)