Skip to content

Instantly share code, notes, and snippets.

View plgcheck
#!/usr/bin/env bash
# version 1.5
# latest version of this script: https://gist.github.com/ljm42/d612bcfbc071d854baba53c482fd64e4
# see also https://forums.unraid.net/topic/103886-permissions-on-files-installed-by-plugins/
#
# run this script to check for file ownership and permission problems on Unraid plugin txz files
#
# to use:
# * cd /tmp
# * wget https://gist.github.com/ljm42/d612bcfbc071d854baba53c482fd64e4/raw -O plgcheck
@ljm42
ljm42 / fix_dynamix_temp
Last active Dec 7, 2020
Fixes an issue with the "Dynamix System Temperature" plugin, adding "bus" line to sensors.conf
View fix_dynamix_temp
#!/bin/bash
#
# version 1.0
# latest version: https://gist.github.com/ljm42/d3132eab72661d0fd725f86f3ed13f65
#
# This is a user script that modifies the "Dynamix System Temperature" plugin version 2020.06.20
# so that it works on systems that require a "bus" line to be added to sensors.conf
#
# NOTE: Once the plugin itself has been updated to generate the "bus" line, you should uninstall this script
#
@ljm42
ljm42 / fix_docker_client
Created Sep 1, 2019
Temporary fix the Docker client for Unraid
View fix_docker_client
#!/bin/bash
# Version 1.0
# Latest version of this script: https://gist.github.com/ljm42/74800562e59639f0fe1b8d9c317e07ab
# This script was tested on Unraid 6.7.2, although it will likely work in previous versions as well. It should not be needed in 6.8
# It will solve the problem reported here: https://forums.unraid.net/bug-reports/stable-releases/dockers-wanting-to-update-but-dont-in-the-end-r618/
# where due to changes in the Docker Hub API, the Unraid Docker client reported that certain Dockers needed to be updated.
# Thanks for @bluemonster for coming up with the fix!
View mount9p
#!/bin/bash
#
# Version 1.4
# Latest version of this script: https://gist.github.com/ljm42/a49268b325df3a2e78d5bafec10b5be7
#
# This script will automatically mount any 9p mount tags that exist
# Designed to be run on Unraid through the User Scripts plugin
#
# 9p docs:
# https://wiki.qemu.org/Documentation/9psetup
@ljm42
ljm42 / check_ttyd
Last active Dec 7, 2020
restart nginx if ttyd is down
View check_ttyd
#!/bin/bash
# restart nginx if ttyd is down
# add to Unraid User Scripts plugin as script named "check_ttyd"
# run every 5 minutes: */5 * * * *
# latest version: https://gist.github.com/ljm42/294968bcecb5308bbcd1c75ae693c680
PROG="check_ttyd user script"
EVENT="Unraid Server Notice"
DESC="Notification from ${PROG}"
TMP=/tmp/check_ttyd
@ljm42
ljm42 / rsyslog_copy
Last active Feb 10, 2021
copy custom rsyslog filter configurations for Unraid
View rsyslog_copy
#!/bin/bash
# copy custom rsyslog filter configurations
# latest version: https://gist.github.com/ljm42/f6d7d8f22d2965909f69c03df53529f6
#
# setup:
# 1. create the /boot/config/custom/rsyslog.d/ folder on your flash drive
# 2. place this script in that folder, name it rsyslog_copy
# 3. add this line to the top of your go script (before starting emhttp):
# bash /boot/config/custom/rsyslog.d/rsyslog_copy
#
@ljm42
ljm42 / bleeding_edge_toolkit.php
Last active Feb 22, 2021
The Bleeding Edge Toolkit for unRAID. Allows you update your system with the latest unreleased webui code.
View bleeding_edge_toolkit.php
#!/usr/bin/php
<?PHP
error_reporting(E_STRICT|E_ALL);
ini_set('display_errors', '1');
/*
bleeding_edge_toolkit Copyright 2018-2019, ljm42
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
@ljm42
ljm42 / rc.nginx
Last active Dec 7, 2020
updates to unRAID's /etc/rc.d/rc.nginx file
View rc.nginx
#!/bin/bash
#
# Nginx daemon control script.
# Written for Slackware Linux by Cherife Li <cherife-#-dotimes.com>.
# limetech: modified for unRAID
# with suggestions from forum member "ljm42"
BIN=/usr/sbin/nginx
PID=/var/run/nginx.pid
View copy_le_certs
#!/bin/bash
# Copyright 2017, ljm42
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2,
# as published by the Free Software Foundation.
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
@ljm42
ljm42 / docker-shell
Last active Sep 19, 2021
A script to easily "docker exec" into a running Docker container
View docker-shell
#!/bin/bash
# easily "docker exec" into a running Docker container
# latest version: https://gist.github.com/ljm42/2b3bfd8ff886015bbce8
# for unRAID, place this script on your flash drive as /boot/custom/docker-shell
# then add this to your go script (without the leading pound sign):
# cp /boot/custom/docker-shell /usr/local/bin
CONTAINERS=`docker ps | awk 'NR==1 {offset=index($0,"NAMES")};NR>1{print substr($0,offset)}' | sort -f | tr "\n" " "`