Skip to content

Commit

Permalink
use EOF with '' as escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
interduo committed Aug 2, 2024
1 parent 4b4599f commit 3a9fb81
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/build_dpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mkdir -p $DEBIAN_DIR $LQOS_DIR/bin/static2 $ETC_DIR $MOTD_DIR

# Create the Debian control file
pushd $DEBIAN_DIR > /dev/null || exit
cat <<EOF > control
cat << EOF > control
Package: $PACKAGE
Version: $VERSION
Architecture: amd64
Expand All @@ -53,7 +53,7 @@ popd > /dev/null || exit
# Create the post-installation file
pushd $DEBIAN_DIR > /dev/null || exit

cat <<EOF > postinst
cat << 'EOF' > postinst
#!/bin/bash
# Install Python Dependencies
pushd /opt/libreqos > /dev/null || exit
Expand All @@ -70,8 +70,8 @@ cp /opt/libreqos/src/bin/lqosd.service.example /etc/systemd/system/lqosd.service
cp /opt/libreqos/src/bin/lqos_scheduler.service.example /etc/systemd/system/lqos_scheduler.service
service_exists() {
local n=\$1
if [[ \$(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == \$n.service ]]; then
local n=$1
if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == $n.service ]]; then
return 0
else
return 1
Expand Down Expand Up @@ -103,7 +103,7 @@ fi
EOF

# Uninstall Script
cat <<EOF > postrm
cat << EOF > postrm
#!/bin/bash
/bin/systemctl --no-block stop lqosd lqos_scheduler
/bin/systemctl disable lqosd lqos_scheduler
Expand Down Expand Up @@ -145,9 +145,9 @@ popd || exit
####################################################
# Add Message of the Day
pushd $MOTD_DIR > /dev/null || exit
cat <<EOF > 99-libreqos
cat << 'EOF' > 99-libreqos
#!/bin/bash
MY_IP=\`hostname -I | cut -d' ' -f1\`
MY_IP=`hostname -I | cut -d' ' -f1`
echo -e "\nLibreQoS Traffic Shaper is installed on this machine.
\nPoint a browser at http://\$MY_IP:9123/ to manage it.\n"
EOF
Expand Down

0 comments on commit 3a9fb81

Please sign in to comment.