Revert "Update saltstack.sh"
This reverts commit 6c9a67718ab81887b010955bf2f2678c86336812.
This commit is contained in:
parent
6c9a67718a
commit
a5e02af570
@ -23,24 +23,13 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//')
|
|
||||||
if [[ ! -d /etc/salt ]]; then
|
if [[ ! -d /etc/salt ]]; then
|
||||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
msg_error "No ${APP} Installation Found!"
|
||||||
case $yn in
|
|
||||||
[Yy]*) break ;;
|
|
||||||
[Nn]*) msg_error "No ${APP} Installation Found!" exit ;;
|
|
||||||
*) echo "Please answer yes or no." ;;
|
|
||||||
esac
|
|
||||||
cat <<EOF >/etc/apt/preferences.d/salt-pin-1001
|
|
||||||
Package: salt-*
|
|
||||||
Pin: version ${RELEASE}
|
|
||||||
Pin-Priority: 1001
|
|
||||||
EOF
|
|
||||||
$STD apt-get install -y salt-master
|
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//')
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
msg_info "Updating $APP to ${RELEASE}"
|
msg_info "Updating $APP to ${RELEASE}"
|
||||||
sed -i "s/^\(Pin: version \).*/\1${RELEASE}/" /etc/apt/preferences.d/salt-pin-1001
|
sed -i "s/^\(Pin: version \).*/\1${RELEASE}/" /etc/apt/preferences.d/salt-pin-1001
|
||||||
|
Loading…
x
Reference in New Issue
Block a user