@@ -56,6 +56,7 @@ run_cmd() {
56
56
" $@ "
57
57
fi
58
58
}
59
+
59
60
# Define templates
60
61
LOG_RUNNER_TEMPLATE=" rules/flipper-runners.logrotate.template"
61
62
UDEV_TEMPLATE=" rules/99-udev-flipper-zero.rules.template"
@@ -94,11 +95,8 @@ run_cmd cp -r services/* "$SERVICES_DIR/"
94
95
if [ ! -f " $UDEV_RULE " ]; then
95
96
echo " Installing udev rule..."
96
97
run_cmd cp " $UDEV_TEMPLATE " " $UDEV_RULE "
97
- if [ " $SIMULATE " = true ]; then
98
- echo " SIMULATE: udevadm control --reload-rules && udevadm trigger"
99
- else
100
- udevadm control --reload-rules && udevadm trigger
101
- fi
98
+ run_cmd udevadm control --reload-rules
99
+ run_cmd udevadm trigger
102
100
else
103
101
echo " Udev rule already exists, skipping installation."
104
102
fi
@@ -108,18 +106,15 @@ if [ ! -f "$BINDER_SERVICE" ]; then
108
106
echo " Installing binder service..."
109
107
run_cmd cp " $BINDER_TEMPLATE " " $BINDER_SERVICE "
110
108
run_cmd cp " $UNBINDER_TEMPLATE " " $UNBINDER_SERVICE "
111
- if [ " $SIMULATE " = true ]; then
112
- echo " SIMULATE: systemctl daemon-reload"
113
- else
114
- run_cmd systemctl daemon-reload
115
- fi
109
+ run_cmd systemctl daemon-reload
116
110
else
117
111
echo " Binder service already exists, skipping installation."
118
112
fi
119
113
120
114
# Install the systemd service using the template.
121
115
if [ -f " $SERVICE_TEMPLATE " ]; then
122
116
echo " Installing systemd service for Flipper runner..."
117
+ # Special handling for the sed command
123
118
if [ " $SIMULATE " = true ]; then
124
119
echo " SIMULATE: sed -e \" s/__FLIPPER_SERIAL__/${FLIPPER_SERIAL} /g\" -e \" s/__STLINK_SERIAL__/${STLINK_SERIAL} /g\" -e \" s/__GITHUB_RUNNER_TAG__/${GITHUB_TAG} /g\" \" $SERVICE_TEMPLATE \" > \" $SERVICE_FILE \" "
125
120
else
132
127
133
128
# Reload systemd and enable the new service.
134
129
echo " Reloading systemd daemon and enabling the service..."
135
- if [ " $SIMULATE " = true ]; then
136
- echo " SIMULATE: systemctl daemon-reload"
137
- echo " SIMULATE: systemctl enable github-runner-flip-${FLIPPER_SERIAL} "
138
- else
139
- run_cmd systemctl daemon-reload
140
- run_cmd systemctl enable " github-runner-flip-${FLIPPER_SERIAL} "
141
- fi
130
+ run_cmd systemctl daemon-reload
131
+ run_cmd systemctl enable " github-runner-flip-${FLIPPER_SERIAL} "
142
132
143
133
# Install service binaries
144
134
echo " Installing service binaries..."
@@ -148,7 +138,6 @@ run_cmd cp services/flipper-docker-wrapper.sh /usr/local/bin/
148
138
run_cmd chmod +x /usr/local/bin/flipper-* .sh
149
139
150
140
# Install logrotation configuration
151
-
152
141
echo " Setting up log rotation..."
153
142
if [ ! -f " /etc/logrotate.d/github-runners" ]; then
154
143
run_cmd cp $LOG_RUNNER_TEMPLATE /etc/logrotate.d/github-runners
0 commit comments