-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Smithsonian/OP1835_newscripts
Op1835 newscripts
- Loading branch information
Showing
11 changed files
with
422 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
# | ||
# Install, enable and run the smax-scripts.service with systemd | ||
# | ||
# This installer should be run as root/with sudo permissions | ||
# | ||
# Paul Grimes | ||
# 04/18/2023 | ||
# | ||
if [ "$EUID" -ne 0 ] | ||
then echo "Please run as root" | ||
exit 1 | ||
fi | ||
|
||
SMAX="/usr/share/smax" | ||
LUA="/usr/share/smax/lua" | ||
|
||
mkdir -p $SMAX | ||
mkdir -p $LUA | ||
|
||
cp -R "./lua" $SMAX | ||
cp "./smax-init.sh" $SMAX | ||
cp "./smax-scripts.service" $SMAX | ||
|
||
chmod -R 755 $SMAX | ||
|
||
ln -s "$SMAX/smax-scripts.service" "/etc/systemd/system/smax-scripts.service" | ||
|
||
read -p "Configure redis for SMA-X at this time? " -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
cp "./redis.conf" "/etc/" | ||
systemctl daemon-reload | ||
systemctl enable redis | ||
systemctl restart redis | ||
fi | ||
|
||
read -p "Enable smax-scripts at this time? " -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
systemctl daemon-reload | ||
systemctl enable smax-scripts | ||
systemctl restart smax-scripts | ||
fi | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Returns all fields names that have a numerical value higher then the supplied lower bound | ||
-- Author: Attila Kovacs | ||
-- Keys: [1] table/meta/struct name | ||
-- Arguments: <lower-bound> | ||
-- Return: field names with numerical values higher than the argument | ||
local result = {} | ||
local k = 1 | ||
local upperbound = tonumber(ARGV[1]) | ||
|
||
local list = redis.call('hgetall', KEYS[1]) | ||
for i,v in pairs(list) do | ||
if i%2 == 0 then | ||
if tonumber(v) < upperbound then | ||
result[k] = list[i-1] | ||
k = k+1 | ||
end | ||
end | ||
end | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.