Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/ubuntu-advantage/ |
Upload File : |
#!/bin/sh
#
# Migrations from previous ubuntu-pro-client/ubuntu-advantage-tools versions
#
# These exist in this script separate from the *.postinst scripts because they
# may need to be called from either ubuntu-pro-client.postinst or from
# ubuntu-advantage-tools.postinst, depending on the situation.
#
# Because ubuntu-advantage-tools Depends on ubuntu-pro-client,
# ubuntu-pro-client.postinst will always be executed before
# ubuntu-advantage-tools.postinst.
#
# If the system already has ubuntu-pro-client and is upgrading to a new version
# of ubuntu-pro-client, that means all migrations present in
# ubuntu-advantage-tools.postinst must have already run at the time the system
# upgraded to the renamed ubuntu-pro-client. That means the migrations in this
# file can and should execute as part of ubuntu-pro-client.postinst.
#
# If upgrading from before the rename to the current version (from before
# version 31), then not necessarily all migrations inside of
# ubuntu-advantage-tools.postinst will have already run. Because the migrations
# present in this file may depend on those previous migrations, then this file
# must execute at the end of ubuntu-advantage-tools.postinst.
#
# In practice, this file is executed conditionally in either
# ubuntu-pro-client.postinst or ubuntu-advantage-tools.postinst using version
# checks. If we're upgrading from a version earlier than 31, then this executes
# in ubuntu-advantage-tools.postinst. If we're upgrading from version 31 or
# later, then this executes in ubuntu-pro-client.postinst.
#
#
#
# Migrations should always be version-gated using PREVIOUS_PKG_VER and execute
# in order from oldest to newest.
#
# For example:
# if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "33~"; then
# # do the migrations to version 33
# fi
# if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "34~"; then
# # do the migrations to version 34
# fi
#
set -e
PREVIOUS_PKG_VER=$1
if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "32~"; then
# When we perform the write operation through
# UserConfigFile we write the public
# version of the user-config file with all the
# sensitive data removed.
# We also move the user-config.json file to the private
# directory
source_file="/var/lib/ubuntu-advantage/user-config.json"
destination_dir="/var/lib/ubuntu-advantage/private"
# Check if the source file exists
if [ -f "$source_file" ]; then
mkdir -p "$destination_dir"
# Move the user-config.json file to the private directory
mv "$source_file" "$destination_dir/user-config.json"
/usr/bin/python3 -c "
from uaclient.files import UserConfigFileObject
try:
user_config_file = UserConfigFileObject()
content = user_config_file.read()
user_config_file.write(content)
except Exception as e:
print('Error while creating public user-config file: {}'.format(e))
"
fi
fi
if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "35~"; then
# Create an only series marker file only if
# the machine-token.json file exists
# This is to ensure that the only-series
# contract check runs correctly
if [ -f "/var/lib/ubuntu-advantage/private/machine-token.json" ]; then
touch "/var/lib/ubuntu-advantage/marker-only-series-check"
fi
# For attached machines, we need to ensure that the apt auth configuration
# is updated to include the snapshot urls for esm-infra and esm-apps
if [ -f "/var/lib/ubuntu-advantage/private/machine-token.json" ]; then
/usr/bin/python3 /usr/lib/ubuntu-advantage/add_esm_snapshot_auth.py
fi
fi