Skip to content

Instantly share code, notes, and snippets.

@bjoern-r
Created February 21, 2022 20:53
Show Gist options
  • Save bjoern-r/dba224479622bb49430c75286f9e363a to your computer and use it in GitHub Desktop.
Save bjoern-r/dba224479622bb49430c75286f9e363a to your computer and use it in GitHub Desktop.
Simple script to start/stop/restart open5gs 5G SA services using systemd
#!/bin/sh
#### amf.yaml ausf.yaml nrf.yaml nssf.yaml pcf.yaml smf.yaml udm.yaml udr.yaml upf.yaml
NFLIST={amf,susf,nrf,nssf,pcf,smf,udm,udr,upf}
dostart() {
for nf in $NFLIST; do
echo systemctl start open5gs-${nf}d
done
}
dostop() {
for nf in $NFLIST; do
echo systemctl stop open5gs-${nf}d
done
}
dorestart() {
for nf in $NFLIST; do
echo systemctl restart open5gs-${nf}d
done
}
case $(basename $0) in
start.sh) dostart ;;
stop.sh) dostop ;;
restart.sh) dorestart ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment