added deployment scripts
This commit is contained in:
17
scripts/getty@tty1.service.d_override.conf
Normal file
17
scripts/getty@tty1.service.d_override.conf
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=reHDD on tty1
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/root/reHDD/
|
||||
ExecStart=
|
||||
ExecStart=-/root/reHDD/reHDD
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
UtmpIdentifier=tty1
|
||||
TTYPath=/dev/tty1
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
SendSIGHUP=yes
|
17
scripts/getty@tty2.service.d_override.conf
Normal file
17
scripts/getty@tty2.service.d_override.conf
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=dmesg on tty2
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/usr/bin/
|
||||
ExecStart=
|
||||
ExecStart=-/usr/bin/dmesg -wH
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
UtmpIdentifier=tty2
|
||||
TTYPath=/dev/tty2
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
SendSIGHUP=yes
|
17
scripts/getty@tty3.service.d_override.conf
Normal file
17
scripts/getty@tty3.service.d_override.conf
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=htop on tty3
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/usr/bin/
|
||||
ExecStart=
|
||||
ExecStart=-/usr/bin/htop
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
UtmpIdentifier=tty3
|
||||
TTYPath=/dev/tty3
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
SendSIGHUP=yes
|
27
scripts/install_reHDD.bash
Normal file
27
scripts/install_reHDD.bash
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /root/reHDD/scripts/
|
||||
|
||||
chmod +x reHDDLogUploader.bash
|
||||
cp reHDDLogUploader.service /lib/systemd/system/reHDDLogUploader.service
|
||||
cp reHDDLogUploader.timer /lib/systemd/system/reHDDLogUploader.timer
|
||||
systemctl daemon-reload
|
||||
systemctl enable /lib/systemd/system/reHDDLogUploader.timer
|
||||
|
||||
chmod +x reHDDStartHelper.bash
|
||||
cp reHDDStartHelper.service /lib/systemd/system/reHDDStartHelper.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable /lib/systemd/system/reHDDStartHelper.service
|
||||
|
||||
mkdir -p /lib/systemd/system/getty@tty1.service.d
|
||||
cp getty@tty1.service.d_override.conf /lib/systemd/system/getty@tty1.service.d/override.conf
|
||||
systemctl daemon-reload
|
||||
|
||||
mkdir -p /lib/systemd/system/getty@tty2.service.d
|
||||
cp getty@tty2.service.d_override.conf /lib/systemd/system/getty@tty2.service.d/override.conf
|
||||
systemctl daemon-reload
|
||||
|
||||
mkdir -p /lib/systemd/system/getty@tty3.service.d
|
||||
cp getty@tty3.service.d_override.conf /lib/systemd/system/getty@tty3.service.d/override.conf
|
||||
systemctl daemon-reload
|
||||
|
6
scripts/reHDDLogUploader.bash
Normal file
6
scripts/reHDDLogUploader.bash
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
# remove comment for the following to activate log telemetie
|
||||
curl -k -T /root/reHDD/reHDD.log -u "__Place_your_token_here__:" -H 'X-Requested-With: XMLHttpRequest' https://schuttercloud.com/public.php/webdav/`echo $(date '+%Y-%m-%d_%H-%M')`_reHDD.log
|
||||
rm -f /root/reHDD/reHDD.log
|
||||
|
||||
|
18
scripts/reHDDLogUploader.service
Normal file
18
scripts/reHDDLogUploader.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=reHDD log uploader
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
Group=root
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/bash /root/reHDD/scripts/reHDDLogUploader.bash
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
|
11
scripts/reHDDLogUploader.timer
Normal file
11
scripts/reHDDLogUploader.timer
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=reHDD log uploader timer
|
||||
|
||||
[Timer]
|
||||
OnActiveSec=30s
|
||||
OnBootSec=10min
|
||||
OnUnitActiveSec=12h
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
4
scripts/reHDDStartHelper.bash
Normal file
4
scripts/reHDDStartHelper.bash
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
dmesg -n 1 #disable overlay if a drive is attached/detached
|
||||
|
||||
|
16
scripts/reHDDStartHelper.service
Normal file
16
scripts/reHDDStartHelper.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[Unit]
|
||||
Description=reHDD start helper
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
Group=root
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/bash /root/reHDD/scripts/reHDDStartHelper.bash
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user