summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/puppet-enable12
-rwxr-xr-xshare/hydractl/system-upgrade5
2 files changed, 12 insertions, 5 deletions
diff --git a/share/hydractl/puppet-enable b/share/hydractl/puppet-enable
index b29603c..bdb4455 100755
--- a/share/hydractl/puppet-enable
+++ b/share/hydractl/puppet-enable
@@ -35,9 +35,13 @@ fi
# Business
if [ "$BASENAME" == "puppet-enable" ]; then
- $sudo sed -i -e 's/START=no/START=yes/' /etc/default/puppet
- $sudo service puppet start
+ if [ -e "/etc/default/puppet" ]; then
+ $sudo sed -i -e 's/START=no/START=yes/' /etc/default/puppet
+ $sudo service puppet start
+ fi
else
- $sudo sed -i -e 's/START=yes/START=no/' /etc/default/puppet
- $sudo service puppet stop
+ if [ -e "/etc/default/puppet" ]; then
+ $sudo sed -i -e 's/START=yes/START=no/' /etc/default/puppet
+ $sudo service puppet stop
+ fi
fi
diff --git a/share/hydractl/system-upgrade b/share/hydractl/system-upgrade
index a8fd13e..374a3b0 100755
--- a/share/hydractl/system-upgrade
+++ b/share/hydractl/system-upgrade
@@ -85,9 +85,12 @@ function hydra_system_upgrade_prepare {
echo ""
echo "Updating apt configuration..."
sed -i -e "s/$release/$nextrelease/g" /etc/apt/sources.list
- sed -i -e "s/$release/$nextrelease/g" /etc/apt/preferences
sed -i -e 's|^deb http://backports.debian.org/debian-backports|#deb http://backports.debian.org/debian-backports|' /etc/apt/sources.list
+ if [ -e "/etc/apt/preferences" ]; then
+ sed -i -e "s/$release/$nextrelease/g" /etc/apt/preferences
+ fi
+
# These will be generated by puppet and can be safely removed
rm -f /etc/apt/sources.list.d/*
rm -f /etc/apt/preferences.d/*