Skip to content

Commit

Permalink
switchto*: fix shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar committed Oct 23, 2024
1 parent 15a2161 commit 2eb072a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
34 changes: 21 additions & 13 deletions switchtoTesting
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
echo "----"
echo "Patching sources.list to enable testing repository..."
echo "----"
for FILE in `ls /etc/apt/sources.list /etc/apt/sources.list.d/*`
do
#!/usr/bin/env bash

cat << EOF
----
Patching sources.list to enable testing repository...
----
EOF

readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
for FILE in "${apt_files[@]}"; do
# (Append 'testing' at the end of lines starting with the yunohost repo..)
sed -i 's@^deb.* http://forge.yunohost.org.*@& testing@' $FILE
sed -i 's@^deb.* http://forge.yunohost.org.*@& testing@' "$FILE"
done

echo "----"
echo "Running 'apt-get update'"
echo "----"
cat << EOF
----
Running 'apt-get update'
----
EOF
apt-get update

echo "----"
echo "Running 'apt-get dist-upgrade'"
echo "----"
cat << EOF
----
Running 'apt-get dist-upgrade'
----
EOF
apt-get dist-upgrade -y

34 changes: 21 additions & 13 deletions switchtoUnstable
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
echo "----"
echo "Patching sources.list to enable testing repository..."
echo "----"
for FILE in `ls /etc/apt/sources.list /etc/apt/sources.list.d/*`
do
#!/usr/bin/env bash

cat << EOF
----
Patching sources.list to enable unstable repository...
----
EOF

readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
for FILE in "${apt_files[@]}"; do
# (Append 'testing' at the end of lines starting with the yunohost repo..)
sed -i 's@^deb http://forge.yunohost.org.*@& testing unstable@' $FILE
sed -i 's@^deb http://forge.yunohost.org.*@& testing unstable@' "$FILE"
done

echo "----"
echo "Running 'apt-get update'"
echo "----"
cat << EOF
----
Running 'apt-get update'
----
EOF
apt-get update

echo "----"
echo "Running 'apt-get dist-upgrade'"
echo "----"
cat << EOF
----
Running 'apt-get dist-upgrade'
----
EOF
apt-get dist-upgrade -y

0 comments on commit 2eb072a

Please sign in to comment.