-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: file:///home/bacon/SVN/auto-admin/auto-admin-0.6.3@545 15dee832-e547-e211-8a70-0017315c2eee
- Loading branch information
1 parent
81e9448
commit acc478a
Showing
20 changed files
with
485 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/sh -e | ||
|
||
########################################################################## | ||
# Script description: | ||
# Make sure ports branch matches pkg repo | ||
# | ||
# History: | ||
# Date Name Modification | ||
# 2020-04-16 J Bacon Begin | ||
########################################################################## | ||
|
||
usage() | ||
{ | ||
printf "Usage: $0\n" | ||
exit 1 | ||
} | ||
|
||
|
||
########################################################################## | ||
# Main | ||
########################################################################## | ||
|
||
if [ $# != 0 ]; then | ||
usage | ||
fi | ||
|
||
case $(auto-ostype) in | ||
FreeBSD) | ||
: ${PORTSDIR:=/usr/ports} | ||
export PORTSDIR | ||
|
||
repo_branch=$(auto-pkg-branch) | ||
if [ ! -e $PORTSDIR/Makefile ]; then | ||
printf "No ports tree at $PORTSDIR. Checking one out now...\n" | ||
auto-ports-checkout | ||
else | ||
ports_branch=$(auto-ports-branch) | ||
if [ $ports_branch != $repo_branch ]; then | ||
cat << EOM | ||
Your binary packages are currently from the $repo_branch branch. | ||
$PORTSDIR is currently using the $ports_branch branch. | ||
Software installed via $PORTSDIR will likely have version mismatches | ||
with the $repo_branch binary packages. To avoid this, you should replace | ||
$PORTSDIR with the $repo_branch ports branch. | ||
EOM | ||
printf "Replace $PORTSDIR with $repo_branch? (y/n) [y] " | ||
read correct | ||
if [ 0$correct != 0n ]; then | ||
# FIXME: Use svn switch where possible: Much faster | ||
printf "Saving $PORTSDIR to $PORTSDIR.old.\n" | ||
mv $PORTSDIR $PORTSDIR.old | ||
auto-ports-checkout | ||
fi | ||
fi | ||
fi | ||
;; | ||
|
||
*) | ||
printf "$0: Not supported on $(auto-ostype).\n" | ||
exit 1 | ||
;; | ||
|
||
esac |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh -e | ||
|
||
########################################################################## | ||
# Script description: | ||
# Enable/disable remote access via ipmitool | ||
# | ||
# History: | ||
# Date Name Modification | ||
# 2020-02-23 Jason Bacon Begin | ||
########################################################################## | ||
|
||
usage() | ||
{ | ||
printf "Usage: $0 on|off\n" | ||
exit 1 | ||
} | ||
|
||
|
||
########################################################################## | ||
# Main | ||
########################################################################## | ||
|
||
if [ $# != 1 ]; then | ||
usage | ||
fi | ||
|
||
auto-root-check $0 | ||
|
||
state="$1" | ||
case "$state" in | ||
on|off) | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
|
||
# http://lists.us.dell.com/pipermail/linux-poweredge/2007-August/032915.html | ||
# FIXME: Is -I open a good idea here? It was in an example. | ||
ipmitool lan set 1 access $state |
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,44 @@ | ||
#!/bin/sh -e | ||
|
||
########################################################################## | ||
# Script description: | ||
# Issue IPMI power control over a node | ||
# | ||
# History: | ||
# Date Name Modification | ||
# 2020-02-02 Jason Bacon Begin | ||
########################################################################## | ||
|
||
usage() | ||
{ | ||
printf "Usage: $0 host-bmc-address on|off\n" | ||
exit 1 | ||
} | ||
|
||
|
||
########################################################################## | ||
# Main | ||
########################################################################## | ||
|
||
if [ $# != 2 ]; then | ||
usage | ||
fi | ||
|
||
auto-operator-check $0 | ||
|
||
host=$1 | ||
state=$2 | ||
case $state in | ||
on|off) | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
|
||
if [ -r /root/.ipmipw ]; then | ||
pw_flags="-f /root/.ipmipw" | ||
fi | ||
|
||
# FIXME: Don't hard-code lanplus, maybe just default to it? | ||
ipmitool -v -I lanplus -H $host -U root $pw_flags chassis power $state |
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,35 @@ | ||
#!/bin/sh -e | ||
|
||
########################################################################## | ||
# Script description: | ||
# Check remote server status using IPMI | ||
# | ||
# History: | ||
# Date Name Modification | ||
# 2020-02-02 Jason Bacon Begin | ||
########################################################################## | ||
|
||
usage() | ||
{ | ||
printf "Usage: $0 host-bmc-address\n" | ||
exit 1 | ||
} | ||
|
||
|
||
########################################################################## | ||
# Main | ||
########################################################################## | ||
|
||
if [ $# != 1 ]; then | ||
usage | ||
fi | ||
|
||
auto-operator-check $0 | ||
|
||
if [ -r /root/.ipmipw ]; then | ||
pw_flags="-f /root/.ipmipw" | ||
fi | ||
|
||
# FIXME: Don't hard-code lanplus | ||
# ipmitool -v -I lanplus -H $1 -U root sel list | ||
ipmitool -v -I lanplus -H $1 -U root $pw_flags chassis status |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh -e | ||
|
||
########################################################################## | ||
# Script description: | ||
# Verify that calling user a member of operator. | ||
# | ||
# History: | ||
# Date Name Modification | ||
# 2019-07-16 Jason Bacon Begin | ||
########################################################################## | ||
|
||
usage() | ||
{ | ||
printf "Usage: $0 calling-script-name\n" | ||
exit 1 | ||
} | ||
|
||
|
||
########################################################################## | ||
# Main | ||
########################################################################## | ||
|
||
if [ $# != 1 ]; then | ||
usage | ||
fi | ||
|
||
if ! groups | fgrep -q operator; then | ||
printf "$1 can only be run by members of operator.\n" | ||
exit 1 | ||
fi |
Oops, something went wrong.